[FFmpeg-cvslog] avformat/wavdec: Check left avio_tell for overflow

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


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sat Sep 30 21:33:34 2023 +0200| [1f5bc3b37b0b05a80909add3b291a4225adfa9d7] | committer: Michael Niedermayer

avformat/wavdec: Check left avio_tell for overflow

Fixes: signed integer overflow: 155 + 9223372036854775655 cannot be represented in type 'long'
Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5364032278495232

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 929ddef3f40102d6a84cfa17ed7c7ffebcf8236e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 0912359133..3a8bc882d8 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -689,6 +689,8 @@ smv_out:
                 goto smv_retry;
             return AVERROR_EOF;
         }
+        if (INT64_MAX - left < avio_tell(s->pb))
+            return AVERROR_INVALIDDATA;
         wav->data_end = avio_tell(s->pb) + left;
     }
 



More information about the ffmpeg-cvslog mailing list