代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/sox 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff --git a/src/hcom.c b/src/hcom.c
index e76820e..fb8de99 100644
--- a/src/hcom.c
+++ b/src/hcom.c
@@ -428,12 +428,19 @@ static int stopwrite(sox_format_t * ft)
{
priv_t *p = (priv_t *) ft->priv;
unsigned char *compressed_data = p->data;
- size_t compressed_len = p->pos;
+ int32_t compressed_len = (int32_t)p->pos;
int rc = SOX_SUCCESS;
+ if (p->pos >> 32 > 0)
+ lsx_warn(
+ "%s: possible data loss"
+ " (the size of data to be written has exceeded its limit)",
+ ft->filename
+ );
+
/* Compress it all at once */
if (compressed_len)
- compress(ft, &compressed_data, (int32_t *)&compressed_len);
+ compress(ft, &compressed_data, &compressed_len);
free(p->data);
/* Write the header */
@@ -447,7 +454,7 @@ static int stopwrite(sox_format_t * ft)
if (lsx_error(ft)) {
lsx_fail_errno(ft, errno, "write error in HCOM header");
rc = SOX_EOF;
- } else if (lsx_writebuf(ft, compressed_data, compressed_len) != compressed_len) {
+ } else if (lsx_writebuf(ft, compressed_data, (size_t) compressed_len) != (size_t) compressed_len) {
/* Write the compressed_data fork */
lsx_fail_errno(ft, errno, "can't write compressed HCOM data");
rc = SOX_EOF;
@@ -456,7 +463,7 @@ static int stopwrite(sox_format_t * ft)
if (rc == SOX_SUCCESS)
/* Pad the compressed_data fork to a multiple of 128 bytes */
- lsx_padbytes(ft, 128u - (compressed_len % 128));
+ lsx_padbytes(ft, (size_t) 128 - (compressed_len % 128));
return rc;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。