diff mbox

[FFmpeg-devel,14/31] h264_redundant_pps: Fix looping over an access unit's units

Message ID 20190619234521.15619-6-andreas.rheinhardt@gmail.com
State Superseded
Headers show

Commit Message

Andreas Rheinhardt June 19, 2019, 11:45 p.m. UTC
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 | 2 ++
 1 file changed, 2 insertions(+)
diff mbox


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 ||