[FFmpeg-cvslog] avcodec/h264_refs: More completely clear slice contexts in ff_h264_remove_all_refs()

Michael Niedermayer git at videolan.org
Sat Apr 4 19:41:09 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr  4 19:30:10 2015 +0200| [aa6f58dd96f32ccf74315da996a5514af6c09687] | committer: Michael Niedermayer

avcodec/h264_refs: More completely clear slice contexts in ff_h264_remove_all_refs()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/h264_refs.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 99cc86b..8e3c214 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -509,8 +509,11 @@ void ff_h264_remove_all_refs(H264Context *h)
     h->short_ref_count = 0;
 
     memset(h->default_ref_list, 0, sizeof(h->default_ref_list));
-    for (i = 0; i < h->nb_slice_ctx; i++)
-        memset(h->slice_ctx[i].ref_list, 0, sizeof(h->slice_ctx[i].ref_list));
+    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));
+    }
 }
 
 /**



More information about the ffmpeg-cvslog mailing list