[FFmpeg-cvslog] avcodec/h264: remove list_count and ref_count clearing

Michael Niedermayer git at videolan.org
Wed Jul 20 00:29:42 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul 19 22:31:57 2016 +0200| [fd1588919d2c70288a1a3fea1aefdd3ea2c424bb] | committer: Michael Niedermayer

avcodec/h264: remove list_count and ref_count clearing

The code conflicts with moving the h264_init_ps() call point

Without this, ff_h264_parse_ref_count() fills ref and list count and
h264_init_ps() subsequently wipes them out on a "success" path.
Subsequently things crash as the wiped fields are used.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fd1588919d2c70288a1a3fea1aefdd3ea2c424bb
---

 libavcodec/h264.c      |    2 --
 libavcodec/h264_refs.c |    5 -----
 2 files changed, 7 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f79735b..db68c05 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -776,8 +776,6 @@ void ff_h264_flush_change(H264Context *h)
     h->frame_recovered = 0;
     h->current_slice = 0;
     h->mmco_reset = 1;
-    for (i = 0; i < h->nb_slice_ctx; i++)
-        h->slice_ctx[i].list_count = 0;
 }
 
 /* forget old pics after a seek */
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 7fafb82..6bac897a 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -581,11 +581,6 @@ void ff_h264_remove_all_refs(H264Context *h)
     h->short_ref_count = 0;
 
     memset(h->default_ref, 0, sizeof(h->default_ref));
-    for (i = 0; i < h->nb_slice_ctx; i++) {
-        H264SliceContext *sl = &h->slice_ctx[i];
-        sl->list_count = sl->ref_count[0] = sl->ref_count[1] = 0;
-        memset(sl->ref_list, 0, sizeof(sl->ref_list));
-    }
 }
 
 static void generate_sliding_window_mmcos(H264Context *h)



More information about the ffmpeg-cvslog mailing list