aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2010-02-28 20:49:21 +0000
committerVitor Sessak <vitor1001@gmail.com>2010-02-28 20:49:21 +0000
commit27dbc47c05e07486feba1ab829db584da2159648 (patch)
treef92670f5aa02f3aa6c63eb778920d717cefa2de3
parentfee6faa2b67fca0cf0889165cfa64b02fc8d395b (diff)
downloadffmpeg-27dbc47c05e07486feba1ab829db584da2159648.tar.gz
Plug some memory leaks in NUT muxer and demuxer
Originally committed as revision 22120 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/nutdec.c4
-rw-r--r--libavformat/nutenc.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index ea2ac86554..8ca59231a8 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -897,9 +897,13 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flag
static int nut_read_close(AVFormatContext *s)
{
NUTContext *nut = s->priv_data;
+ int i;
av_freep(&nut->time_base);
av_freep(&nut->stream);
+ av_tree_destroy_free_elem(nut->syncpoints);
+ for(i = 1; i < nut->header_count; i++)
+ av_freep(&nut->header[i]);
return 0;
}
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 03d3712638..8509aa2faa 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -797,6 +797,9 @@ static int write_trailer(AVFormatContext *s){
while(nut->header_count<3)
write_headers(nut, bc);
put_flush_packet(bc);
+ av_freep(&nut->stream);
+ av_freep(&nut->time_base);
+ av_tree_destroy_free_elem(nut->syncpoints);
return 0;
}