h264_redundant_pps: Fix looping over an access unit's units
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 19 Jun 2019 23:45:04 +0000 (01:45 +0200)
committerMark Thompson <sw@jkqxz.net>
Sun, 7 Jul 2019 21:59:16 +0000 (22:59 +0100)
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 <andreas.rheinhardt@gmail.com>
libavcodec/h264_redundant_pps_bsf.c

index 80b8634..907e95b 100644 (file)
@@ -97,6 +97,8 @@ static int h264_redundant_pps_filter(AVBSFContext *bsf, AVPacket *pkt)
                 err = ff_cbs_delete_unit(ctx->input, au, i);
                 if (err < 0)
                     goto fail;
+                i--;
+                continue;
             }
         }
         if (nal->type == H264_NAL_SLICE ||