From patchwork Fri Sep 7 23:46:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dale Curtis X-Patchwork-Id: 10273 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:12c4:0:0:0:0:0 with SMTP id 65-v6csp61451jap; Fri, 7 Sep 2018 16:54:29 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZZJkblN/JPT/hNpHy9kN3vIq36Qgcz6+flzRBI3oXiHazQXL2Wnun1bea7EBHEaPoN7MTa X-Received: by 2002:adf:f28c:: with SMTP id k12-v6mr8142767wro.263.1536364469827; Fri, 07 Sep 2018 16:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536364469; cv=none; d=google.com; s=arc-20160816; b=ECXvSbLdmDTO0dnU/eo8g5b/hbiRUGHPsl9Ld7Ku6p1rO3XczYAxuA/TgLdh4WZwJW mDkPwWKwlhfIwflmbyU6vjAp8u6/xcOaO+85CVyZysTazdABrCTbet+1TnBnFtKrQn4q Q1N8pLD0qldg1iBVH/febWTQOqXpCeCNDPxMhmyOVPjY9StUs5oaqsESbUbpqwwyR7Il ubDZ3NzvACGatFeGn5W+ucFAkFcW9UjLgT8YOYUytC+joq1YGrnpucbeLgi05/YoPUBD b1n8//C8kdU1LWsfvSWhBSGN7PbURdcTtlMsMkQ9hoo08IcEQQfuaoRzTyyD6miUkT4o cgAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=J2+mrq0SHXAq/wDzyzjk9n86IiS3LoX+3TqiuRrd2Ls=; b=Elld+4vGBB2BYdujDRKZWfj4GVEgWQzuUbXVSHDkYEuE+0mOW76Gygah3BoVTZEKRc Qr3HQrKJ8ZdvD84RJQc1Cz8oKfUfwpgatypNoc72M7sTzyuywvpR6HWyPtIb95SRyXIU 9w5deQZk6qrpzbHNQ0rqdo5JoTi6p7rXdWKrXMzTfhrEKOfWN1yREvmOVtwXwc5R8bkz 56sC5RpMSEn1s8LgS6SxPVW36iQm95ON2jvoKIazZYXWtlN1ATygT0JLYj1tJ9bIZLrB mRk8LlxHKr851zBXdDF0vZ7aCDgFSk2sbhbvaQ0A3kTWUJmU/3R7wteUUQAvTkSvu/Fn xEtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@chromium.org header.s=google header.b=PkRVDBAY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t7-v6si6989685wmh.61.2018.09.07.16.54.29; Fri, 07 Sep 2018 16:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@chromium.org header.s=google header.b=PkRVDBAY; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D4254689F2F; Sat, 8 Sep 2018 02:54:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8B321689EF0 for ; Sat, 8 Sep 2018 02:54:12 +0300 (EEST) Received: by mail-yb1-f177.google.com with SMTP id h22-v6so6042072ybg.12 for ; Fri, 07 Sep 2018 16:54:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=ifflueQbxvJ7sM3kpKckyZC7/AblZhaCaGiZEqycfy8=; b=PkRVDBAYQgHZCoss7SKpXSFPb3+xqsrj2hUY2vRZ1UQ2Sz3+FE7DWVtXyYiecF/KB0 c4iWN3ff/32fnoVNDJZL3gsWPJU5dM+gAZkB7Baxlz+xHu+c2pDmwUFytV2SXc3v49IK UIhpaAKZArRKMP9VDNcQJt+IzegkSZ0P+86IY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ifflueQbxvJ7sM3kpKckyZC7/AblZhaCaGiZEqycfy8=; b=Hpdvd6uW47K/L8gg0P7ddPGvlKBjJ7MVVcWPTM08SHRJTg7JcoTJlN6ZZYhe4wJP+9 Z6MaHPkRd9BgQieJGDASkmufhv/ByPhLCJRhy/VTuwmq+VInjLNqot63yWjhdAvtD01l c7xbpxa+wuzLikBUz7q9C3c5KksfxcFSdLveTVI5iTb70aMqqF7v9rpIjzbEkeQHyA+B oH01DtIagUui+9o8BFcM1Nma6rxVRxAQ8KdivPy+TeR+5gLCTbJXrZ8Q2PrfK4Z+QU3b NgETz1M3aNPcTD/g/cPloR+BJ5CFN+oZVgHxBbKXEVKKWTRiHZ4s4F6dqghx+7b99IUB uKzg== X-Gm-Message-State: APzg51Az9Ne1zQihQDtMT/RZnKNSSRpX1buDbeqcFELrOoTl/Wf6gjzY 1Jxroy1Z/fP8KfFB4HBPdX8s6eAz+bxSPzPH9ZuXSNGFusE= X-Received: by 2002:a25:bb92:: with SMTP id y18-v6mr5408606ybg.467.1536363973662; Fri, 07 Sep 2018 16:46:13 -0700 (PDT) MIME-Version: 1.0 From: Dale Curtis Date: Fri, 7 Sep 2018 16:46:02 -0700 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] Don't calculate duration using AV_NOPTS_VALUE for start_time. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Found by ClusterFuzz, https://crbug.com/879852 From 68614e9a099ee4ae754da5fa36fbb6a570f4aa73 Mon Sep 17 00:00:00 2001 From: Dale Curtis 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