From patchwork Mon Jun 17 03:42:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13568 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 90D26447BCA for ; Mon, 17 Jun 2019 06:49:18 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 733F0689A81; Mon, 17 Jun 2019 06:49:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 52844689A7A for ; Mon, 17 Jun 2019 06:49:12 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id m3so8268831wrv.2 for ; Sun, 16 Jun 2019 20:49:12 -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=cdxTD367wt7fTxTUwkpasPmvZpF0tD4w6axxXivQeNQ=; b=urft72OY3MNsQsgR/YRhQF8HJjQj814cYjND3fHY1hBtoSrQLWpSV4o6JRHd12YRmj PzUQ+4rmM7HJyd5lSdBjmKbWv1JLBahp8KDy36Ku0OqZohORe6I25chvKfT/zrpyNTDv ITRjgLfXSw6ecN9en5tyJs+e/WtLrLoTwXfaAMi7VnVC1gl7N+j6k5tDkkxyx8Leo6wQ tX7XMgK4fi+e/iY13ygvMVrbi2eKJwcivAJ4YBGPE08ks0Dje538ZavyB5/+k5+1A+U/ bKQDmsr3BORQUn/z9hyqimFIaDQz38xX0tsVLrA2AV9KegOYA+VA2qhIMjFP0c4K1mzO kocA== 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=cdxTD367wt7fTxTUwkpasPmvZpF0tD4w6axxXivQeNQ=; b=Yxrg/3ti7s89uUu1DBBNYMyLLL4EU9OGXI2RHxWp2YUm45Rnh5O7psv5DzqUCAlDfr AlgQH3AVcGF+Qehh3ihfNX3NAGJ2As+1EP3AF0PLMPtTp0MlbQwRKPMCPP/XHRfs3f7R pBiQeddM1bUHsPXswt/MSKrbx85gDB4ynO7i/PqswAGVbKV3L+64s1qJbq0VPBhB+LdU wcvhRLFskoBDZJM7exij5JYNzMc6HQGiUBM6nK0bzGZdlylhRMUCiiIlEUDEOQ7ojvKe cFhvpZYLL9xg+zsuEySV2xiC3eifacVhgJFiMl2FOncQL70zaa68/fqTTOzSN2+eolou 9yeg== X-Gm-Message-State: APjAAAVee1zlYwYxWEHiU4+vv75jTwj7CuW1/L5otrsXpR3GkohisviC q9o4DrxqzDJyarUNV8Z5J6W0/MM7 X-Google-Smtp-Source: APXvYqzwJQZDiNzo2PyMmKiw4ns5G02esuuNs3VRABu/K4T3rSj9yHIMbFpXsM+uv0UtqKeG9vHJ8g== X-Received: by 2002:adf:81c8:: with SMTP id 66mr71227305wra.261.1560743043862; Sun, 16 Jun 2019 20:44:03 -0700 (PDT) Received: from localhost.localdomain (ipbcc063db.dynamic.kabel-deutschland.de. [188.192.99.219]) by smtp.gmail.com with ESMTPSA id x83sm9632889wmb.42.2019.06.16.20.44.02 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 16 Jun 2019 20:44:03 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Jun 2019 05:42:18 +0200 Message-Id: <20190617034223.21195-14-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190617034223.21195-1-andreas.rheinhardt@gmail.com> References: <20190617034223.21195-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 13/18] h264_redundant_pps: Fix looping over an access unit's units 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" When looping over an access unit's units in positive direction and deleting some of them, one needs to make sure that a unit that is at the position of a unit that just got deleted gets checked, too. Signed-off-by: Andreas Rheinhardt --- libavcodec/h264_redundant_pps_bsf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/h264_redundant_pps_bsf.c b/libavcodec/h264_redundant_pps_bsf.c index f8b0f9ac0a..8405738c4b 100644 --- a/libavcodec/h264_redundant_pps_bsf.c +++ b/libavcodec/h264_redundant_pps_bsf.c @@ -95,6 +95,8 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *pkt) av_log(bsf, AV_LOG_VERBOSE, "Deleting redundant PPS " "at %"PRId64".\n", pkt->pts); ff_cbs_delete_unit(ctx->input, au, i); + i--; + continue; } } if (nal->type == H264_NAL_SLICE ||