From f1b4023d99ad0b55c1d3cb4cff707fbd1d305f62 Mon Sep 17 00:00:00 2001 From: manh-td Date: Fri, 19 Dec 2025 09:47:21 +0800 Subject: [PATCH] Fix DoS due to lack of eof check --- contrib/sdk/sources/ffmpeg/ffmpeg-2.1/libavformat/mvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/sdk/sources/ffmpeg/ffmpeg-2.1/libavformat/mvdec.c b/contrib/sdk/sources/ffmpeg/ffmpeg-2.1/libavformat/mvdec.c index 5525233db..224d56537 100644 --- a/contrib/sdk/sources/ffmpeg/ffmpeg-2.1/libavformat/mvdec.c +++ b/contrib/sdk/sources/ffmpeg/ffmpeg-2.1/libavformat/mvdec.c @@ -306,6 +306,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);