[FFmpeg-cvslog] avcodec/parser: ensure input padding is zeroed

Kacper Michajłow git at videolan.org
Fri May 16 20:56:46 EEST 2025


ffmpeg | branch: release/4.2 | Kacper Michajłow <kasper93 at gmail.com> | Thu Jun 27 02:40:35 2024 +0200| [607d002a9dc558ce1baa2251815210d238f1d4e7] | committer: Michael Niedermayer

avcodec/parser: ensure input padding is zeroed

Fixes use of uninitialized value, reported by MSAN.

Found by OSS-Fuzz.

Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>

Fixes: 70852/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5179190066872320
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 5dfc0cc84129758b4eab2acdc3e186c3116deacd)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 3e19810a94..9fe3789692 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -267,6 +267,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;
     }



More information about the ffmpeg-cvslog mailing list