[FFmpeg-devel] [PATCH 1/4] bsf/media100_to_mjpegb: Clear output buffer padding

Michael Niedermayer michael at niedermayer.cc
Sun Aug 4 17:23:12 EEST 2024


Fixes: use-of-uninitialized-value
Fixes: 70855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MEDIA100_fuzzer-5537446610141184

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

diff --git a/libavcodec/bsf/media100_to_mjpegb.c b/libavcodec/bsf/media100_to_mjpegb.c
index 6e117ae20fb..4b2dc1a35ac 100644
--- a/libavcodec/bsf/media100_to_mjpegb.c
+++ b/libavcodec/bsf/media100_to_mjpegb.c
@@ -148,6 +148,7 @@ second_field:
     AV_WB32(out->data + second_field_offset + 36, sod_offset[1] - second_field_offset);
 
     out->size = bytestream2_tell_p(&pb);
+    memset(out->data + out->size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
 
     ret = av_packet_copy_props(out, in);
     if (ret < 0)
-- 
2.45.2



More information about the ffmpeg-devel mailing list