diff mbox series

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

Message ID 20240804142315.1430389-1-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/4] bsf/media100_to_mjpegb: Clear output buffer padding | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Aug. 4, 2024, 2:23 p.m. UTC
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@niedermayer.cc>
---
 libavcodec/bsf/media100_to_mjpegb.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Michael Niedermayer Aug. 14, 2024, 3:08 p.m. UTC | #1
On Sun, Aug 04, 2024 at 04:23:12PM +0200, Michael Niedermayer wrote:
> 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@niedermayer.cc>
> ---
>  libavcodec/bsf/media100_to_mjpegb.c | 1 +
>  1 file changed, 1 insertion(+)

will apply the remaining 2 patches of this set

[...]
diff mbox series

Patch

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)