]> git.sesse.net Git - ffmpeg/commitdiff
avformat/wavdec: Avoid zeroing written to array
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 9 Nov 2020 19:53:27 +0000 (20:53 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 3 Jan 2021 00:16:25 +0000 (01:16 +0100)
Fixes: OOM
Fixes: 26934/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5996784213819392
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/wavdec.c

index 35c5e442a8d25422ab044db1c22114b8ebad9b01..3da4150f0587154acd4fd7aaa72461d493cbd0c6 100644 (file)
@@ -917,7 +917,7 @@ static int w64_read_header(AVFormatContext *s)
                 if (chunk_size == UINT32_MAX || (filesize >= 0 && chunk_size > filesize))
                     return AVERROR_INVALIDDATA;
 
-                value = av_mallocz(chunk_size + 1);
+                value = av_malloc(chunk_size + 1);
                 if (!value)
                     return AVERROR(ENOMEM);