[FFmpeg-devel] [PATCH 1/8] avcodec/apac: Clean padding space

Michael Niedermayer michael at niedermayer.cc
Sun Aug 4 23:53:02 EEST 2024


Fixes: use-of-uninitialized-value
Fixes: 70842/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APAC_fuzzer-5758325067677696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/apac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/apac.c b/libavcodec/apac.c
index f740fb5553b..068ad095300 100644
--- a/libavcodec/apac.c
+++ b/libavcodec/apac.c
@@ -159,6 +159,7 @@ static int apac_decode(AVCodecContext *avctx, AVFrame *frame,
     buf                = &s->bitstream[s->bitstream_index];
     buf_size          += s->bitstream_size;
     s->bitstream_size  = buf_size;
+    memset(buf + buf_size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
     frame->nb_samples = s->bitstream_size * 16 * 8;
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-- 
2.45.2



More information about the ffmpeg-devel mailing list