diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-04-19 15:48:40 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-19 15:48:40 +0000 |
commit | 5ae2c73e4d5ab813bf826c166bb0b287bc189e92 (patch) | |
tree | e49fbeb3e5230aa6383bb74d32ed97d8e0ba6c15 /libavformat/avidec.c | |
parent | 8975ba81f8b949809e8d855168029011f14f2670 (diff) | |
download | ffmpeg-5ae2c73e4d5ab813bf826c166bb0b287bc189e92.tar.gz |
memleaks
Originally committed as revision 1793 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r-- | libavformat/avidec.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 0e045bdecb..50899b07c4 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -236,7 +236,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) 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 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) /* check stream number */ if (stream_index != s->nb_streams - 1) { fail: + av_free(avi->buf); for(i=0;i<s->nb_streams;i++) { av_freep(&s->streams[i]->codec.extradata); av_freep(&s->streams[i]); @@ -373,6 +374,16 @@ pkt_init: static int avi_read_close(AVFormatContext *s) { + int i; + AVIContext *avi = s->priv_data; + av_free(avi->buf); + + for(i=0;i<s->nb_streams;i++) { + AVStream *st = s->streams[i]; +// av_free(st->priv_data); + av_free(st->codec.extradata); + } + return 0; } |