aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-09-22 23:15:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-09-24 15:37:20 +0200
commit56bef2fd58d0ed30dbe940083c30ada2b0404491 (patch)
tree295d1bf5b923a51118b5ff5f829387378ffc9fb7
parent03050a0d9092c57757a10b9e3c96e89e047d25bc (diff)
downloadffmpeg-56bef2fd58d0ed30dbe940083c30ada2b0404491.tar.gz
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@niedermayer.cc>
-rw-r--r--libavcodec/xan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index cc0ecea5eb..56675dbbb1 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -607,6 +607,9 @@ static int xan_decode_frame(AVCodecContext *avctx, AVFrame *frame,
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;