From 88f1cb99aa9b2e9c8936a03ff9f75701f3501df2 Mon Sep 17 00:00:00 2001 From: tabudz Date: Wed, 11 Mar 2026 00:35:52 +0800 Subject: [PATCH] avformat/mvdec: Fix DoS due to lack of eof check Fixes: loop.mv Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer --- 3rdparty/ffmpeg/libavformat/mvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3rdparty/ffmpeg/libavformat/mvdec.c b/3rdparty/ffmpeg/libavformat/mvdec.c index 7aa6452f..e3feda66 100644 --- a/3rdparty/ffmpeg/libavformat/mvdec.c +++ b/3rdparty/ffmpeg/libavformat/mvdec.c @@ -338,6 +338,8 @@ static int mv_read_header(AVFormatContext *avctx) uint32_t pos = avio_rb32(pb); uint32_t asize = avio_rb32(pb); uint32_t vsize = avio_rb32(pb); + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; avio_skip(pb, 8); av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME); av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);