[FFmpeg-cvslog] avcodec/mvha: Clear remaining space after inflate()

Michael Niedermayer git at videolan.org
Thu Feb 27 19:06:54 EET 2025


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Sat Aug  3 19:11:33 2024 +0200| [4eceda75288bca8902614c9bc651f7a4e3c55793] | committer: Michael Niedermayer

avcodec/mvha: Clear remaining space after inflate()

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 at niedermayer.cc>
(cherry picked from commit cba4e2e40dec1ff2ce534fec87c7e3e8bef7ff9b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/mvha.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index c603ef6975..9c7706aad7 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -187,6 +187,8 @@ static int decode_frame(AVCodecContext *avctx,
                     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')) {



More information about the ffmpeg-cvslog mailing list