From 87b98689726360f61bacb7681a05ba677a218751 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 1 Jul 2012 20:29:52 +0200 Subject: [PATCH] h264: clear the ref lists when the reference are cleared. Fixes reading of freed arrays (Ticket1498) Found-by: Piotr Bandurski Signed-off-by: Michael Niedermayer --- libavcodec/h264_refs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index 926a6cc40d..d68a7d8b0f 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -443,6 +443,9 @@ void ff_h264_remove_all_refs(H264Context *h){ h->short_ref[i]= NULL; } h->short_ref_count=0; + + memset(h->default_ref_list, 0, sizeof(h->default_ref_list)); + memset(h->ref_list, 0, sizeof(h->ref_list)); } /**