diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-03-05 00:51:38 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-05-26 14:45:28 +0200 |
commit | 4e377ec8dcd1e93be630b1e15815e935e47e55f9 (patch) | |
tree | 7eb4b407b850f665fd2602c3b480f1b48c3bad2f /libavformat | |
parent | bb34d18e33e17c15f9188b7d2a587d85ee5166c8 (diff) | |
download | ffmpeg-4e377ec8dcd1e93be630b1e15815e935e47e55f9.tar.gz |
avformat/wavdec: Check that smv block fits in available space
Fixes: OOM
Fixes: 56271/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-5290810045497344
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a76efafdb9be966ae3ad52b32370dc644dd582bf)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/wavdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 4d2524f126..396ec30dab 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -647,6 +647,10 @@ smv_retry: goto smv_out; } size = avio_rl24(s->pb); + if (size > wav->smv_block_size) { + ret = AVERROR_EOF; + goto smv_out; + } ret = av_get_packet(s->pb, pkt, size); if (ret < 0) goto smv_out; |