From 9740add317675a3722adc3e8057c4860ac579f64 Mon Sep 17 00:00:00 2001 From: ziyugao Date: Thu, 10 Oct 2024 01:25:12 +0000 Subject: [PATCH 1/4] update libswscale/swscale.c. fix ffmpeg bug Signed-off-by: ziyugao --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 7b40f49da4..0e3d63a5e2 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -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; } From e4512b804f611f639a44251c7b7d28f0c6964a59 Mon Sep 17 00:00:00 2001 From: ziyugao Date: Thu, 10 Oct 2024 01:27:28 +0000 Subject: [PATCH 2/4] update libavformat/asf.c. fix bug Signed-off-by: ziyugao --- libavformat/asf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/asf.c b/libavformat/asf.c index 1285062220..72cfdfd5f1 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -89,7 +89,7 @@ static int asf_read_picture(AVFormatContext *s, int len) return 0; } - if (picsize >= len) { + if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) { av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n", picsize, len); return AVERROR_INVALIDDATA; From 3387af21cd81a140d6cb8ea63d52a8f9c43f4888 Mon Sep 17 00:00:00 2001 From: ziyugao Date: Thu, 10 Oct 2024 02:37:33 +0000 Subject: [PATCH 3/4] update libavformat/asf.c. Signed-off-by: ziyugao --- libavformat/asf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/asf.c b/libavformat/asf.c index 72cfdfd5f1..ac036b8f67 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -90,7 +90,7 @@ static int asf_read_picture(AVFormatContext *s, int len) } if (picsize >= len || ((int64_t)len - picsize) * 2 + 1 > INT_MAX) { - av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d >= %d.\n", + av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len= %d).\n", picsize, len); return AVERROR_INVALIDDATA; } From e6477f00a224f2102274fc653c3ef7934d17cce0 Mon Sep 17 00:00:00 2001 From: ziyugao Date: Thu, 10 Oct 2024 04:02:52 +0000 Subject: [PATCH 4/4] update libavformat/asf.c. Signed-off-by: ziyugao --- libavformat/asf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/asf.c b/libavformat/asf.c index ac036b8f67..2a5859ed68 100644 --- a/libavformat/asf.c +++ b/libavformat/asf.c @@ -90,7 +90,7 @@ static int asf_read_picture(AVFormatContext *s, int len) } 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", + av_log(s, AV_LOG_ERROR, "Invalid attached picture data size: %d (len = %d).\n", picsize, len); return AVERROR_INVALIDDATA; }