!281 修改ffmpeg问题

Merge pull request !281 from ziyugao/master
This commit is contained in:
openharmony_ci 2024-10-10 06:23:48 +00:00 committed by Gitee
commit f329f07d1f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 3 additions and 3 deletions

View File

@ -89,8 +89,8 @@ static int asf_read_picture(AVFormatContext *s, int len)
return 0;
}
if (picsize >= len) {
av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n",
if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) {
av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len = %d).\n",
picsize, len);
return AVERROR_INVALIDDATA;
}

View File

@ -222,7 +222,7 @@ static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
int i;
int32_t *dst = (int32_t *) _dst;
for (i = 0; i < width; i++)
dst[i] = (dst[i]*(14071/4) + (33561947<<4)/4)>>12;
dst[i] = ((int)(dst[i]*(14071U/4) + (33561947<<4)/4)) >> 12;
}