diff --git a/backport-CVE-2024-36617.patch b/backport-CVE-2024-36617.patch new file mode 100644 index 0000000000000000000000000000000000000000..5d27d32e2f047a8ea309e0d4d62953136a137603 --- /dev/null +++ b/backport-CVE-2024-36617.patch @@ -0,0 +1,31 @@ +From d973fcbcc2f944752ff10e6a76b0b2d9329937a7 Mon Sep 17 00:00:00 2001 +From: Michael Niedermayer +Date: Sat, 30 Sep 2023 00:38:17 +0200 +Subject: [PATCH] avformat/cafdec: dont seek beyond 64bit + +Fixes: signed integer overflow: 64 + 9223372036854775807 cannot be represented in type 'long long' +Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6418242730328064 +Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-6418242730328064 + +Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg +Signed-off-by: Michael Niedermayer +--- + libavformat/cafdec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c +index 8622859..f5c62a8 100644 +--- a/libavformat/cafdec.c ++++ b/libavformat/cafdec.c +@@ -209,7 +209,7 @@ static int read_pakt_chunk(AVFormatContext *s, int64_t size) + st->duration += caf->frames_per_packet ? caf->frames_per_packet : ff_mp4_read_descr_len(pb); + } + +- if (avio_tell(pb) - ccount > size) { ++ if (avio_tell(pb) - ccount > size || size > INT64_MAX - ccount) { + av_log(s, AV_LOG_ERROR, "error reading packet table\n"); + return AVERROR_INVALIDDATA; + } +-- +2.43.0 + diff --git a/backport-CVE-2024-36618.patch b/backport-CVE-2024-36618.patch new file mode 100644 index 0000000000000000000000000000000000000000..db1f0dfc6a8cf85ec3819f928f76014fda7d04b4 --- /dev/null +++ b/backport-CVE-2024-36618.patch @@ -0,0 +1,31 @@ +From 7a089ed8e049e3bfcb22de1250b86f2106060857 Mon Sep 17 00:00:00 2001 +From: Andreas Rheinhardt +Date: Tue, 12 Mar 2024 23:23:17 +0100 +Subject: [PATCH] avformat/avidec: Fix integer overflow iff ULONG_MAX < + INT64_MAX + +Affects many FATE-tests, see +https://fate.ffmpeg.org/report.cgi?time=20240312011016&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu + +Reviewed-by: James Almer +Signed-off-by: Andreas Rheinhardt +--- + libavformat/avidec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavformat/avidec.c b/libavformat/avidec.c +index 59c06ea..81e904d 100644 +--- a/libavformat/avidec.c ++++ b/libavformat/avidec.c +@@ -1645,7 +1645,7 @@ static int check_stream_max_drift(AVFormatContext *s) + int *idx = av_mallocz_array(s->nb_streams, sizeof(*idx)); + if (!idx) + return AVERROR(ENOMEM); +- for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1LU) { ++ for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1ULL) { + int64_t max_dts = INT64_MIN / 2; + int64_t min_dts = INT64_MAX / 2; + int64_t max_buffer = 0; +-- +2.43.0 + diff --git a/ffmpeg.spec b/ffmpeg.spec index 96f01c0b9671239444802d4e347d51ffe697b345..0e5d4edc19262b4563ae30aa153d026b18a27b65 100644 --- a/ffmpeg.spec +++ b/ffmpeg.spec @@ -60,7 +60,7 @@ Summary: Digital VCR and streaming server Name: ffmpeg%{?flavor} Version: 4.2.4 -Release: 20 +Release: 21 License: %{ffmpeg_license} URL: http://ffmpeg.org/ %if 0%{?date} @@ -91,6 +91,8 @@ Patch19: backport-CVE-2024-35366.patch Patch20: backport-CVE-2024-35367.patch Patch21: backport-CVE-2024-35368.patch Patch22: backport-CVE-2024-36616.patch +Patch23: backport-CVE-2024-36618.patch +Patch24: backport-CVE-2024-36617.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} %{?_with_cuda:BuildRequires: cuda-minimal-build-%{_cuda_version_rpm} cuda-drivers-devel} @@ -424,6 +426,9 @@ install -pm755 tools/qt-faststart %{buildroot}%{_bindir} %changelog +* Fri Dec 13 2024 liningjie - 4.2.4-21 +- fix CVE-2024-36617 CVE-2024-36618 + * Mon Dec 02 2024 liningjie - 4.2.4-20 - fix CVE-2024-35368 CVE-2024-36616