[FFmpeg-cvslog] avformat/img2dec: Clear padding data after EOF

Michael Niedermayer git at videolan.org
Tue Aug 6 00:57:54 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sun Aug  4 22:00:35 2024 +0200| [d7256bf014f8da3997b3b3b5edc3544204505575] | committer: Michael Niedermayer

avformat/img2dec: Clear padding data after EOF

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
Reviewed-by: Kacper Michajlow <kasper93 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3978e81809a3daf278199849f7bbeacbffb9fa09)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/img2dec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index c291c356eb..7d173d8030 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -553,6 +553,7 @@ int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
         }
         goto fail;
     } else {
+        memset(pkt->data + pkt->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
         s->img_count++;
         s->img_number++;
         s->pts++;



More information about the ffmpeg-cvslog mailing list