ffmpeg | branch: release/4.4 | Michael Niedermayer <mich...@niedermayer.cc> | 
Sun May 11 01:08:06 2025 +0200| [29561e3758d4417ce8f8f96bd1fdb81dd35af936] | 
committer: Michael Niedermayer

avcodec/sonic: Check num_taps

The encoder uses max 128 taps, which is quiet a lot already
If work is done to improve sonic, it will be more radical than changing the taps

Fixes: Timeout
Fixes: 
402539974/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6122944271286272

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit fd0a792766c8ae513dd849fc47fa9e899cc5664b)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

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

diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c
index ea107d4ff6..b13cdc3c12 100644
--- a/libavcodec/sonic.c
+++ b/libavcodec/sonic.c
@@ -917,6 +917,9 @@ static av_cold int sonic_decode_init(AVCodecContext *avctx)
     if (get_bits1(&gb)) // XXX FIXME
         av_log(avctx, AV_LOG_INFO, "Custom quant table\n");
 
+    if (s->num_taps > 128)
+        return AVERROR_INVALIDDATA;
+
     s->block_align = 2048LL*s->samplerate/(44100*s->downsampling);
     s->frame_size = s->channels*s->block_align*s->downsampling;
 //    avctx->frame_size = s->block_align;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to