diff mbox series

[FFmpeg-devel,5/8] avcodec/shorten: clear padding

Message ID 20240804205309.1978196-5-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/8] avcodec/apac: Clean padding space | expand

Checks

Context Check Description
yinshiyou/make_fate_loongarch64 success Make fate finished
yinshiyou/make_loongarch64 warning New warnings during build
andriy/make_fate_x86 success Make fate finished
andriy/make_x86 warning New warnings during build

Commit Message

Michael Niedermayer Aug. 4, 2024, 8:53 p.m. UTC
Fixes: use-of-uninitialized-value
Fixes: 70854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5533480570650624

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

Patch

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 102992e2b2c..12a179156a7 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -563,6 +563,7 @@  static int shorten_decode_frame(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);
 
     /* do not decode until buffer has at least max_framesize bytes or
      * the end of the file has been reached */