# HG changeset patch # User michaelni # Date 1050767320 0 # Node ID 9fd9b0f9e9d84b129696786d802c1c2d1f271750 # Parent c82a6062485ea377e02a1816649afcb28e8816cb memleaks diff -r c82a6062485e -r 9fd9b0f9e9d8 avidec.c --- a/avidec.c Sat Apr 19 15:18:00 2003 +0000 +++ b/avidec.c Sat Apr 19 15:48:40 2003 +0000 @@ -236,7 +236,7 @@ get_le32(pb); /* ClrImportant */ st->codec.extradata_size= size - 10*4; - st->codec.extradata= av_malloc(st->codec.extradata_size); //FIXME where should we free this? + st->codec.extradata= av_malloc(st->codec.extradata_size); get_buffer(pb, st->codec.extradata, st->codec.extradata_size); if(st->codec.extradata_size & 1) //FIXME check if the encoder really did this correctly @@ -272,6 +272,7 @@ /* check stream number */ if (stream_index != s->nb_streams - 1) { fail: + av_free(avi->buf); for(i=0;inb_streams;i++) { av_freep(&s->streams[i]->codec.extradata); av_freep(&s->streams[i]); @@ -373,6 +374,16 @@ static int avi_read_close(AVFormatContext *s) { + int i; + AVIContext *avi = s->priv_data; + av_free(avi->buf); + + for(i=0;inb_streams;i++) { + AVStream *st = s->streams[i]; +// av_free(st->priv_data); + av_free(st->codec.extradata); + } + return 0; }