From patchwork Tue Oct 15 11:17:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15761 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 6675C4468B3 for ; Tue, 15 Oct 2019 14:25:43 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5197168A1B9; Tue, 15 Oct 2019 14:25:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F045068978D for ; Tue, 15 Oct 2019 14:25:36 +0300 (EEST) Received: by mail-wr1-f66.google.com with SMTP id j11so23413028wrp.1 for ; Tue, 15 Oct 2019 04:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=im1kFuVvzBuvlAjS19qu3qyTASfUblEMfigI0Fdn9z4=; b=Cf5OGEI9lgiS1e61A/ZrPFfGI7jo/2Q7SNS+0D9CW8VKD29OdHvX9/c15y1tWJ8vky 8pHBk2dNeisvGPsj+pFV0od4f/h0+qYf8n58cSWZfuNrvgfIkE7t2ZdWQLCc8maDGd3m WTSdfeTbTO+n1U72aSI1U3NpnniE6Kj06X7sXsRi5Bwpi4CpyS9QF5Ppo441ImSsjjYy MsqG+FdUg+ehjB2s1sSOOchuSJHXHeJ2g46m1gsWbKVdmced7qNMjwciLWM/65BVTDba yGTK8DLvZIWbJ300iFLdM/gdGqiM1xddTMY3VjtwPxayRphEe7thcYKmUUyJxTh4ucAQ +NHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=im1kFuVvzBuvlAjS19qu3qyTASfUblEMfigI0Fdn9z4=; b=b4p6WVUg96/Wk57QbPEL/iLt1JalYc8AOzvVeY/QmVwnMj8HT5pR1e8mQXkqBpth+H 6GzCPG4130pOH5BHWH5qhC6bNkSm4x8c8qKc5zxiFXdWbXVlxzctw2W4hXwCoWcnPekS WXOlV7K/CTl3eZmA4PV/3I7aN84YmzyjHjrgiSh5Da8Ws7hLGQ6mIHlhMyvBAvKTIjnG XNMW5HJ4/7f8L9amlrZ6zYybq2q0s3ZcA0YB6pzinwerh0F4PTIOwBJh7qY6qwwOks2P vSpyHeBCce6oC58NHQ7Gx1Bpbd5J2wJWVKSg12PvuiO5MLcZG7ecQGuHPSF0uEd2gMPu GOiw== X-Gm-Message-State: APjAAAWj4AZt3AlyXG/+6+DPCKYK+E13HnsySqE5kEWRmh6rNHKfJFCM 4xQs5pdrOz5JkaIyQ2MfJ6mKaLex X-Google-Smtp-Source: APXvYqxcq5zWhFoVHud+lKt13rJUwJc/ELJvugZMn0+IxDxJlqWVyfG4031D8GAKuf5kEr0wF9rQnA== X-Received: by 2002:a5d:52c8:: with SMTP id r8mr31065160wrv.132.1571138736006; Tue, 15 Oct 2019 04:25:36 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc08937.dynamic.kabel-deutschland.de. [188.192.137.55]) by smtp.gmail.com with ESMTPSA id y3sm4364637wmg.2.2019.10.15.04.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 04:25:35 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 15 Oct 2019 13:17:32 +0200 Message-Id: <20191015111737.14246-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191015111737.14246-1-andreas.rheinhardt@gmail.com> References: <20191015111737.14246-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/9] avformat/matroskaenc: Remove redundant 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The Matroska muxer groups index entries with the same pts together in order to save a few bytes. Because of Matroska's variable-length length fields, mkv_write_cues() does this by first finding out how many index entries will be grouped together before actually writing them. Currently, it is asserted at both of these stages that the stream index of the list of designated index entries is valid. But the second assert is redundant, because the very same index entries have already been checked. Signed-off-by: Andreas Rheinhardt --- libavformat/matroskaenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index e024c58c84..eb8977ff9c 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -601,7 +601,7 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra tracks[j].has_cue = 0; for (j = 0; j < cues->num_entries - i && entry[j].pts == pts; j++) { int tracknum = entry[j].stream_idx; - av_assert0(tracknum>=0 && tracknumstreams[tracknum]->codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) continue; tracks[tracknum].has_cue = 1;