diff mbox series

[FFmpeg-devel,4/5] avformat/tta: Use 64bit intermediate for index

Message ID 20210117225311.17297-4-michael@niedermayer.cc
State Accepted
Commit fd61b42b4c8709a7888fa5c9cce0c19d754e39fc
Headers show
Series [FFmpeg-devel,1/5] avformat/sccdec: Use larger intermediate for ts/next_ts computation
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 17, 2021, 10:53 p.m. UTC
Fixes: signed integer overflow: 42032 * 51092 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-6679539648430080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/tta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/tta.c b/libavformat/tta.c
index 70e98b2937..46c2508bce 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -119,7 +119,7 @@  static int tta_read_header(AVFormatContext *s)
     for (i = 0; i < c->totalframes; i++) {
         uint32_t size = avio_rl32(s->pb);
         int r;
-        if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
+        if ((r = av_add_index_entry(st, framepos, i * (int64_t)c->frame_size, size, 0,
                                     AVINDEX_KEYFRAME)) < 0)
             return r;
         framepos += size;