summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2023-11-22 22:17:37 +0000
committerMichael Niedermayer <michael@niedermayer.cc>2023-12-02 00:25:15 +0100
commit2182173a6933c02b0853751034bd5e0bf829b5f7 (patch)
tree7df025848f2e4d85ecbe3f44996d8410fb347832 /libavformat
parentdb7b8382376e6b49cfc44583036759be59156f22 (diff)
avformat/mov: Fix integer overflow in mov_read_packet().
Fixes https://crbug.com/1499669: runtime error: signed integer overflow: 9223372036853334272 + 1375731456 cannot be represented in type 'int64_t' (aka 'long') Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 34ca8095c2..f7b5ec7a35 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -9006,7 +9006,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->flags |= AV_PKT_FLAG_DISCARD;
}
if (sc->ctts_data && sc->ctts_index < sc->ctts_count) {
- pkt->pts = pkt->dts + sc->dts_shift + sc->ctts_data[sc->ctts_index].duration;
+ pkt->pts = av_sat_add64(pkt->dts, av_sat_add64(sc->dts_shift, sc->ctts_data[sc->ctts_index].duration));
/* update ctts context */
sc->ctts_sample++;
if (sc->ctts_index < sc->ctts_count &&