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>2016-01-09 05:36:19 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-09 05:38:03 +0300
commit6e249466cc6bd5b17d6e8cbd9a84a636cc92fd60 (patch)
treeef3501680b9c4be01122a4d814161a40d4aacb0f /libavformat
parentbe0f005da639a36147a25426a8663b0c7339062d (diff)
avformat/movenc: Check that pkt duration is within 32bit range
Durations outside are not supported Fixes Ticket5114 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5594c6d913..1aff5c52f4 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4362,10 +4362,10 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
pkt->dts = trk->cluster[trk->entry - 1].dts + 1;
pkt->pts = AV_NOPTS_VALUE;
}
- if (pkt->duration < 0) {
- av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is invalid\n", pkt->duration);
- return AVERROR(EINVAL);
- }
+ }
+ if (pkt->duration < 0 || pkt->duration > INT_MAX) {
+ av_log(s, AV_LOG_ERROR, "Application provided duration: %"PRId64" is invalid\n", pkt->duration);
+ return AVERROR(EINVAL);
}
if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
int ret;