h264: clear the ref lists when the reference are cleared.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 1 Jul 2012 18:29:52 +0000 (20:29 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 1 Jul 2012 18:49:31 +0000 (20:49 +0200)
Fixes reading of freed arrays (Ticket1498)

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264_refs.c

index 926a6cc..d68a7d8 100644 (file)
@@ -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));
 }
 
 /**