From patchwork Wed Jun 19 23:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13620 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 AA179448AA5 for ; Thu, 20 Jun 2019 02:55:40 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8872368AB08; Thu, 20 Jun 2019 02:55:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACCE668AAE4 for ; Thu, 20 Jun 2019 02:55:38 +0300 (EEST) Received: by mail-wm1-f67.google.com with SMTP id u8so1256145wmm.1 for ; Wed, 19 Jun 2019 16:55:38 -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=xxYXR/G6OxEanoRWvtiK+Ui0I9yfD8Vg1xyk3hr3vF8=; b=tXDc0qefusu/WMEyStyIOyQzivHbN544ioNscSHjAapo1osLAi6dFtoPk5jApiSELg eDwD76WUuikt8bxNfy7U5tSuG0EyoSV+F4ybZ+MseU6aGdYMaVJ47iMPCJTwS98FIIUO nzoM77tmXt9LA/WU98Q4qIG64LxNOQ72sssgVJPOPcOh3qLBwB0Yy3ruUZl4uZcTiYEa LZpiZb3cDfmu3gObuPVgzHRABnCq2ewasvWtyBYE4uokaFwXRVIJZIEzcOFDcvWj0J5R EnYBrRYOFao0F6EQ9PYnc7+Fm9KWjzKvuxFPRkmosU6gN4bOTEuAX9hStVQ0q/OXyEV1 OLKw== 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=xxYXR/G6OxEanoRWvtiK+Ui0I9yfD8Vg1xyk3hr3vF8=; b=qwfRj5WxZ4186n2v+V3LPYbBh2fTLMHz8ub4gkZz8tCt5gp9JpLC5CUfsjxEiH3T62 Noq2x1V7ZtLHSeEwCdnT7iNYWgZIC8Zpcpiszo8pIeMFBJib32r7Mw84Kpf9XAGK8OR4 8h3G2yXf6cdHyEa9f8fxIp8hl+stSLgRKpY844i1bZ2SRcLx0G8S/Lnh3Yi6m3qOGJ7r +va0rXeK588T6GxI2o5uU1fkXFa62PsnFpi4HjXsdJXPWwkTMiHwuQvsOyGsDOeOAyPT jVt9l2/2iH8vTkaHKglRIyp65X96uVY5l+l+gQERhLk7VQ6ubM5pmbEACFJOnTIRfbpj L84A== X-Gm-Message-State: APjAAAWiT16ply2iJaf7Oki8r1bpyblUJuVANFITwTiK8PsilJ89XI1C tuG89/GypKU0wAkXiow2LBtAv9g/ X-Google-Smtp-Source: APXvYqyCSQ0XiycRWr3p5dcwk1jYKu5IpTx9X0FgyZ3v/1HuNC7acMVTBKPackooX4r+4p8uigX32w== X-Received: by 2002:a1c:c289:: with SMTP id s131mr9852839wmf.115.1560988537988; Wed, 19 Jun 2019 16:55:37 -0700 (PDT) Received: from localhost.localdomain (ipbcc063db.dynamic.kabel-deutschland.de. [188.192.99.219]) by smtp.gmail.com with ESMTPSA id t63sm2758989wmt.6.2019.06.19.16.55.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 16:55:37 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Jun 2019 01:45:04 +0200 Message-Id: <20190619234521.15619-6-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190619234521.15619-1-andreas.rheinhardt@gmail.com> References: <20190617034223.21195-1-andreas.rheinhardt@gmail.com> <20190619234521.15619-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 14/31] 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 e1f8f673f9..ed34f9dc6e 100644 --- a/libavcodec/h264_redundant_pps_bsf.c +++ b/libavcodec/h264_redundant_pps_bsf.c @@ -96,6 +96,8 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *pkt) "at %"PRId64".\n", pkt->pts); // This call never fails as the fragment has a unit at pos. i. ff_cbs_delete_unit(ctx->input, au, i); + i--; + continue; } } if (nal->type == H264_NAL_SLICE ||