diff mbox

[FFmpeg-devel] Don't calculate duration using AV_NOPTS_VALUE for start_time.

Message ID CAPUDrwfhWvUwDFWyxsDCX9633Tcib6fHfKD5fp8BoBGGhW0b2g@mail.gmail.com
State New
Headers show

Commit Message

Dale Curtis Sept. 7, 2018, 11:46 p.m. UTC
Found by ClusterFuzz, https://crbug.com/879852

Comments

Michael Niedermayer Sept. 9, 2018, 1:41 a.m. UTC | #1
On Fri, Sep 07, 2018 at 04:46:02PM -0700, Dale Curtis wrote:
> Found by ClusterFuzz, https://crbug.com/879852

>  utils.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> e5a29fc92c11899d4c54660cb17ff822058a5837  fix-av-nopts-start-time.patch
> From 68614e9a099ee4ae754da5fa36fbb6a570f4aa73 Mon Sep 17 00:00:00 2001
> From: Dale Curtis <dalecurtis@chromium.org>
> Date: Fri, 7 Sep 2018 15:37:09 -0700
> Subject: [PATCH] Don't calculate duration using AV_NOPTS_VALUE for start_time.
> 
> Found by ClusterFuzz, https://crbug.com/879852
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

thx

[...]
diff mbox

Patch

From 68614e9a099ee4ae754da5fa36fbb6a570f4aa73 Mon Sep 17 00:00:00 2001
From: Dale Curtis <dalecurtis@chromium.org>
Date: Fri, 7 Sep 2018 15:37:09 -0700
Subject: [PATCH] Don't calculate duration using AV_NOPTS_VALUE for start_time.

Found by ClusterFuzz, https://crbug.com/879852
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 15c0c4bddc..8e0bd5d697 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;
-- 
2.19.0.rc2.392.g5ba43deb5a-goog