[FFmpeg-cvslog] avcodec/xan: Add basic input size check

Michael Niedermayer git at videolan.org
Thu Feb 27 19:07:33 EET 2025


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 22 23:15:35 2024 +0200| [3c005e89b208f2096f826af491d5ea2a52da2d92] | committer: Michael Niedermayer

avcodec/xan: Add basic input size check

Fixes: Timeout
Fixes: 71739/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XAN_WC3_fuzzer-6170301405134848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 56bef2fd58d0ed30dbe940083c30ada2b0404491)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c005e89b208f2096f826af491d5ea2a52da2d92
---

 libavcodec/xan.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 1ccf164847..c8f098d17c 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -614,6 +614,9 @@ static int xan_decode_frame(AVCodecContext *avctx,
         return AVERROR_INVALIDDATA;
     }
 
+    if (buf_size < 9)
+        return AVERROR_INVALIDDATA;
+
     if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list