Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-05 00:32:40 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-09 22:32:57 +0300
commit86cbbd66cd12b162f006f2ea25e860eab6727204 (patch)
treedc65c1cf263dceaf55327f3018a6637063a32eb2
parent3ca6eeff7711183a14b02fe36af2d4cb3733be27 (diff)
avformat/iff: simplify duration calculation
Fixes: signed integer overflow: 315680096256 * 134215943 cannot be represented in type 'long long' Fixes: 48713/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5886272312311808 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 0740641e932551342cc1737d981e950ecffa3b63) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/iff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/iff.c b/libavformat/iff.c
index e086c6d671..cf4d42ecab 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -385,7 +385,7 @@ static int read_dst_frame(AVFormatContext *s, AVPacket *pkt)
avio_skip(pb, 1);
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->stream_index = 0;
- pkt->duration = 588LL * s->streams[0]->codecpar->sample_rate / 44100;
+ pkt->duration = s->streams[0]->codecpar->sample_rate / 75;
pkt->pos = chunk_pos;
chunk_pos = avio_tell(pb);
@@ -398,7 +398,8 @@ static int read_dst_frame(AVFormatContext *s, AVPacket *pkt)
case ID_FRTE:
if (data_size < 4)
return AVERROR_INVALIDDATA;
- s->streams[0]->duration = avio_rb32(pb) * 588LL * s->streams[0]->codecpar->sample_rate / 44100;
+ s->streams[0]->duration = avio_rb32(pb) * (uint64_t)s->streams[0]->codecpar->sample_rate / 75;
+
break;
}