avformat/utils: Don't calculate duration using AV_NOPTS_VALUE for start_time.
authorDale Curtis <dalecurtis@chromium.org>
Fri, 7 Sep 2018 22:37:09 +0000 (15:37 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 9 Sep 2018 10:01:07 +0000 (12:01 +0200)
Found by ClusterFuzz, https://crbug.com/879852

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c

index b0b5e16..a72f0a4 100644 (file)
@@ -3869,7 +3869,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
                 break;
             }
             if (pkt->duration) {
-                if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && pkt->pts >= st->start_time) {
+                if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && st->start_time != AV_NOPTS_VALUE && pkt->pts >= st->start_time) {
                     st->info->codec_info_duration = FFMIN(pkt->pts - st->start_time, st->info->codec_info_duration + pkt->duration);
                 } else
                     st->info->codec_info_duration += pkt->duration;