From patchwork Wed Jun 13 17:10:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 9391 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp892766jad; Wed, 13 Jun 2018 10:11:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKaV3xTunQeyLWhfCDGG3wzEMiPdFaRf74J+eYx4E7M/7v8IW/G6kT0AB1uSSii4VzggX8d X-Received: by 2002:adf:d10a:: with SMTP id a10-v6mr4688275wri.18.1528909872105; Wed, 13 Jun 2018 10:11:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528909872; cv=none; d=google.com; s=arc-20160816; b=tgUosfxIMEEuuETAhUyWFFw0dsSsiNMEx7J2oenlaY7RQ1lwmvF8DAzRLhrpJpQsb+ RjhC/cXAVcVB/tLLo6Yck1P5WgyYArp5wx9Q1henkl5D13MuesQdwr6hJozqjC+ACcBq 1Nsl+oWg7EqUnrar4xmgnAU8ZurW/3tp7252H+tmBmIntrcRiO/c3XbkwnHh9xFGCHVr EcRsiHLo9Km3XaJcdA1Vm1EEidovUgw2uxxoJH911MNQk/zsFwhWunjs8zXSeWnzY0k9 THNy5Cl6k5fRuezbVB8xdRAqbTzR2FS2kxV8yHIafURpT3XMsa2lhEO6qCLySclIl7sD ggdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=BbAuhCEqyJ6rhCk3FBT/xtOFtQjD1g1eMdI1y4M3e1M=; b=r5wNL+FYd8geLEyR3f9ZJqA9dUTkRsM0iDdldme3V+Ka+5zT03LQcKYQqGgkQOkcWQ jxeQCs3M+QUjR6Dgg2N/0+EdUypf24cFv6tw1SVqyeGP55VnwrmSuXbHBulUaND44X/q /2cJB96BKu/BIEsY4BTKTO1GLi1KRLbWsQwXC/bKnDC4XET25otiMB0L8xgQg6RcSGjv AjnM8X6SXnuyt5U99Dn2Wn3ZJfcykjfO8cht2O0aNZRC2AxQD1jGqTHYuHzhDfkZ3Cxt V/eJCzb1ysaBiZj4GV/NYJGmmNBPrDiS1kHdShLHWIzVkSRlic6vaz0GjLfNkpoSrVAJ 9nYA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m187-v6si2335938wmm.112.2018.06.13.10.11.10; Wed, 13 Jun 2018 10:11:12 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B1DED68B0FB; Wed, 13 Jun 2018 20:10:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 967F568B0B4 for ; Wed, 13 Jun 2018 20:10:12 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fT9IU-00026D-87 for ffmpeg-devel@ffmpeg.org; Wed, 13 Jun 2018 19:11:02 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id yHAw1x00l0S5wYM01HAxTT; Wed, 13 Jun 2018 19:10:57 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 13 Jun 2018 19:10:27 +0200 Message-Id: <20180613171027.12538-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180613171027.12538-1-michael@niedermayer.cc> References: <20180613171027.12538-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 3/3] ffmpeg: assert that audio packet duration in process_input_packet() is non negative 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- fftools/ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index ba8789a43c..a31994bbdd 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2710,6 +2710,7 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo ist->dts = ist->next_dts; switch (ist->dec_ctx->codec_type) { case AVMEDIA_TYPE_AUDIO: + av_assert0(pkt->duration >= 0); if (ist->dec_ctx->sample_rate) { ist->next_dts += ((int64_t)AV_TIME_BASE * ist->dec_ctx->frame_size) / ist->dec_ctx->sample_rate;