From patchwork Wed Nov 22 12:04:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 6267 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp76450jah; Wed, 22 Nov 2017 04:04:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMYwllb38JCcxSU6f/HpYPMlYd4SZzMd2b6PT1mqi9dkGItZ3ClOByvcsuBzjLVfHEBL/FSO X-Received: by 10.28.193.139 with SMTP id r133mr4297049wmf.39.1511352299491; Wed, 22 Nov 2017 04:04:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511352299; cv=none; d=google.com; s=arc-20160816; b=RHSZ8Tmbpc8gaG8I7LDl4vpv5bYYR6GigjnOFij8MtJujIvTUKxe/rmGU++shwhgaF eQgm4khk4/g/SydELlO36vukUWrAc8qoa1Us7Q6nRCq9xhSwjLsMWRDXXROHfEcE1XX7 ib0SUxJFsvcJx9iMTy1m4abxI1MlczM3X4t/d+mvpP37YMPR1zhD/JXdSz/x9OlMjZt7 8dv8f82QkDJCMKvokVLH/4bWaeo9bzep2BNIVn0FYcNqciBONg3kUFp32z/b+tuQ+RI9 sJ6KzaygfP0KLul05Rug0I4IJzjLhnNVhcXB01fCNHjiiSVoa6MmnvaaGd0J0edwKDHp w5vg== 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:message-id:date:to:from:delivered-to :arc-authentication-results; bh=ljRr+jR5UAGBw1NbcYgyFUsTU57wzdF6mRD3PgG/GAs=; b=JseU5KlRPpizbI7Jy6b7i0iIa/KIRqb/Xd/XIOZdA70dC0vpLrojRtsvMzzL1LCPRO +dBeK3ddiad7aTgRnX8lihto7YRskFri8DCl1uo9lb36RrgKbpapPc0233/rQkxE06Nc 0VniXV11PrQxEJp+HhLb6XyMRJm8N1kt29BjU6h+qkzJ936TXzD9LKxDRcl7k2m7xxqf o60CeDxTEPvHLRi2TYzBHo1USEOqpjFoDl6Au1D6sQig4zOdr4K5KkWydxjbo3Ulix8T 6fEpQ4y3gjlRxEf1OqZYftGT18Oq/eVvVPlPx5uev2hWEmOgC03NsAMrqZN8oyTnJruS M4TA== 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 c38si12701530wrc.538.2017.11.22.04.04.58; Wed, 22 Nov 2017 04:04:59 -0800 (PST) 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 5533368A119; Wed, 22 Nov 2017 14:04:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 625DE68A099 for ; Wed, 22 Nov 2017 14:04:50 +0200 (EET) Received: from [172.31.218.35] (helo=vie01a-dmta-pe02-2.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eHTlq-0007Kv-Ai for ffmpeg-devel@ffmpeg.org; Wed, 22 Nov 2017 13:04:50 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eHTlk-0000zM-Ll for ffmpeg-devel@ffmpeg.org; Wed, 22 Nov 2017 13:04:44 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id d04a1w01d0S5wYM0104buX; Wed, 22 Nov 2017 13:04:35 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 22 Nov 2017 13:04:34 +0100 Message-Id: <20171122120434.14250-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.0 Subject: [FFmpeg-devel] [PATCH] libavformat/mov: Replace duplicate stream_nb check by assert 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 --- libavformat/mov.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 9e876efc8c..6940dfc7d5 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2437,8 +2437,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) MOVStreamContext *sc; int pseudo_stream_id; - if (c->fc->nb_streams < 1) - return 0; + av_assert0 (c->fc->nb_streams >= 1); st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data;