aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-04 19:30:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-04 19:30:10 +0200
commitaa6f58dd96f32ccf74315da996a5514af6c09687 (patch)
tree39a97296d0a21d0efc98e7abecaf511d5f7857be
parentfc58d5c43b4c7396fc69081eb0dfe5b6a21cb10d (diff)
downloadffmpeg-aa6f58dd96f32ccf74315da996a5514af6c09687.tar.gz
avcodec/h264_refs: More completely clear slice contexts in ff_h264_remove_all_refs()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264_refs.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 99cc86b4f7..8e3c21455d 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));
+ }
}
/**