[FFmpeg-cvslog] h264: clear the ref lists when the reference are cleared.

Michael Niedermayer git at videolan.org
Sun Jul 1 20:50:02 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jul  1 20:29:52 2012 +0200| [87b98689726360f61bacb7681a05ba677a218751] | committer: Michael Niedermayer

h264: clear the ref lists when the reference are cleared.

Fixes reading of freed arrays (Ticket1498)

Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/h264_refs.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 926a6cc..d68a7d8 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));
 }
 
 /**



More information about the ffmpeg-cvslog mailing list