From 549f4b8d0609f6ae7d2282a0ea6b638208726df4 Mon Sep 17 00:00:00 2001 From: tabudz Date: Sun, 8 Mar 2026 22:39:23 +0800 Subject: [PATCH] avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: out of array access Fixes: ffmpeg_bof_1.avi Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart Signed-off-by: Michael Niedermayer --- 3rdparty/ffmpeg/libavformat/movenc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3rdparty/ffmpeg/libavformat/movenc.c b/3rdparty/ffmpeg/libavformat/movenc.c index b9c0f7ae..2e690e52 100644 --- a/3rdparty/ffmpeg/libavformat/movenc.c +++ b/3rdparty/ffmpeg/libavformat/movenc.c @@ -377,6 +377,12 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track) info->ec3_done = 1; goto concatenate; } + } else { + if (hdr->substreamid != 0) { + avpriv_request_sample(mov->fc, "Multiple non EAC3 independent substreams"); + ret = AVERROR_PATCHWELCOME; + goto end; + } } /* fill the info needed for the "dec3" atom */