Commit 6e249466 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/movenc: Check that pkt duration is within 32bit range

Durations outside are not supported

Fixes Ticket5114
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent be0f005d
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment