comparison 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
comparison
equal deleted inserted replaced
3143:ef36cc95e4ab 3144:84406a59134c
3907 3907
3908 /* forget old pics after a seek */ 3908 /* forget old pics after a seek */
3909 static void flush_dpb(AVCodecContext *avctx){ 3909 static void flush_dpb(AVCodecContext *avctx){
3910 H264Context *h= avctx->priv_data; 3910 H264Context *h= avctx->priv_data;
3911 int i; 3911 int i;
3912 for(i=0; i<16; i++) 3912 for(i=0; i<16; i++) {
3913 if(h->delayed_pic[i])
3914 h->delayed_pic[i]->reference= 0;
3913 h->delayed_pic[i]= NULL; 3915 h->delayed_pic[i]= NULL;
3916 }
3917 if(h->delayed_output_pic)
3918 h->delayed_output_pic->reference= 0;
3914 h->delayed_output_pic= NULL; 3919 h->delayed_output_pic= NULL;
3915 idr(h); 3920 idr(h);
3916 if(h->s.current_picture_ptr) 3921 if(h->s.current_picture_ptr)
3917 h->s.current_picture_ptr->reference= 0; 3922 h->s.current_picture_ptr->reference= 0;
3918 } 3923 }