[FFmpeg-cvslog] avformat/wavdec: Check that smv block fits in available space

Michael Niedermayer git at videolan.org
Sun Apr 14 23:23:07 EEST 2024


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Mar  5 00:51:38 2023 +0100| [49f063c5c91191c47fe0f3e3452924c457e08b17] | committer: Michael Niedermayer

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

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

 libavformat/wavdec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 8dbed90690..0df6172b31 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -660,6 +660,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;



More information about the ffmpeg-cvslog mailing list