[FFmpeg-cvslog] avformat/utils: Don't calculate duration using AV_NOPTS_VALUE for start_time.

Dale Curtis git at videolan.org
Sun Sep 9 13:03:09 EEST 2018


ffmpeg | branch: master | Dale Curtis <dalecurtis at chromium.org> | Fri Sep  7 15:37:09 2018 -0700| [8ef7fb86d62c9d44697c8eef0ddc424be4a3612b] | committer: Michael Niedermayer

avformat/utils: Don't calculate duration using AV_NOPTS_VALUE for start_time.

Found by ClusterFuzz, https://crbug.com/879852

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8ef7fb86d62c9d44697c8eef0ddc424be4a3612b
---

 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index b0b5e164a6..a72f0a482e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -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;



More information about the ffmpeg-cvslog mailing list