diff mbox series

[FFmpeg-devel,3/4] avcodec/mvha: Clear remaining space after inflate()

Message ID 20240804142315.1430389-3-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: 70838/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-4878509466517504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/mvha.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index 24dd88e8542..4aad56640ee 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -183,6 +183,8 @@  static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
                     av_log(avctx, AV_LOG_ERROR, "Inflate error: %d\n", ret);
                     return AVERROR_EXTERNAL;
                 }
+                if (zstream->avail_out > 0)
+                    memset(zstream->next_out, 0, zstream->avail_out);
             }
         }
     } else if (type == MKTAG('H','U','F','Y')) {