changeset 3144:84406a59134c libavcodec

fix a memory leak on seeking.
author lorenm
date Sat, 25 Feb 2006 22:15:24 +0000
parents ef36cc95e4ab
children ede5c3c0a0eb
files h264.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Fri Feb 24 09:16:26 2006 +0000
+++ b/h264.c	Sat Feb 25 22:15:24 2006 +0000
@@ -3909,8 +3909,13 @@
 static void flush_dpb(AVCodecContext *avctx){
     H264Context *h= avctx->priv_data;
     int i;
-    for(i=0; i<16; i++)
+    for(i=0; i<16; i++) {
+        if(h->delayed_pic[i])
+            h->delayed_pic[i]->reference= 0;
         h->delayed_pic[i]= NULL;
+    }
+    if(h->delayed_output_pic)
+        h->delayed_output_pic->reference= 0;
     h->delayed_output_pic= NULL;
     idr(h);
     if(h->s.current_picture_ptr)