diff mbox series

[FFmpeg-devel,09/13] avformat/rpl: Use 64bit for duration computation

Message ID 20220918171410.31835-9-michael@niedermayer.cc
State Accepted
Commit 529f64b2eb98e0c3ae4944abd5d01fa7c1def047
Headers show
Series [FFmpeg-devel,01/13] avformat/flvdec: Use 64bit for sum_flv_tag_size | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer Sept. 18, 2022, 5:14 p.m. UTC
Fixes: signed integer overflow: 24709512 * 88 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6737973728641024

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

Patch

diff --git a/libavformat/rpl.c b/libavformat/rpl.c
index d025589bfc3..3ef6fda3862 100644
--- a/libavformat/rpl.c
+++ b/libavformat/rpl.c
@@ -279,7 +279,7 @@  static int rpl_read_header(AVFormatContext *s)
     error |= read_line(pb, line, sizeof(line));  // size of "helpful" sprite
     if (vst) {
         error |= read_line(pb, line, sizeof(line));  // offset to key frame list
-        vst->duration = number_of_chunks * rpl->frames_per_chunk;
+        vst->duration = number_of_chunks * (int64_t)rpl->frames_per_chunk;
     }
 
     // Read the index