[FFmpeg-cvslog] avcodec/smacker: Check input before allocation
Michael Niedermayer
git at videolan.org
Mon Jul 7 01:24:31 EEST 2025
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 3 03:03:04 2025 +0200| [af3852e22c599a79357c2cc3e164a5efa697be53] | committer: Michael Niedermayer
avcodec/smacker: Check input before allocation
Fixes: Timeout
Fixes: 421650030/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKAUD_fuzzer-6144441767493632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af3852e22c599a79357c2cc3e164a5efa697be53
---
libavcodec/smacker.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index bd08bc7be2..99009bfd36 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -662,6 +662,10 @@ static int smka_decode_frame(AVCodecContext *avctx, AVFrame *frame,
} else
values[i] = h.entries[0].value;
}
+ if (get_bits_left(&gb) < (stereo+1) * (bits+1) * 8) {
+ ret = AVERROR_INVALIDDATA;
+ goto error;
+ }
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
More information about the ffmpeg-cvslog
mailing list