[FFmpeg-devel] [PATCH 4/8] avcodec/parser: clear padding in combine frame

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


Fixes: use-of-uninitialized-value
Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320

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/parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index af17ee9c156..426cc314fb0 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -236,6 +236,7 @@ int ff_combine_frame(ParseContext *pc, int next,
         }
         pc->buffer = new_buffer;
         memcpy(&pc->buffer[pc->index], *buf, *buf_size);
+        memset(&pc->buffer[pc->index + *buf_size], 0, AV_INPUT_BUFFER_PADDING_SIZE);
         pc->index += *buf_size;
         return -1;
     }
-- 
2.45.2



More information about the ffmpeg-devel mailing list