mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/wavdec: Check if there are 16 bytes before testing them
Fixes: use-of-uninitialized-value Fixes: 70839/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5212907590189056 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
e0f9f4d491
commit
79a1cf30d1
|
@ -874,8 +874,7 @@ static int w64_read_header(AVFormatContext *s)
|
||||||
uint8_t guid[16];
|
uint8_t guid[16];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
avio_read(pb, guid, 16);
|
if (avio_read(pb, guid, 16) != 16 || memcmp(guid, ff_w64_guid_riff, 16))
|
||||||
if (memcmp(guid, ff_w64_guid_riff, 16))
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
/* riff + wave + fmt + sizes */
|
/* riff + wave + fmt + sizes */
|
||||||
|
|
Loading…
Reference in New Issue