diff h264.c @ 3144:84406a59134c libavcodec

fix a memory leak on seeking.
author lorenm
date Sat, 25 Feb 2006 22:15:24 +0000
parents c12fc3d1c612
children ede5c3c0a0eb
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)