Browse Source

Plug some memory leaks in NUT muxer and demuxer

Originally committed as revision 22120 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Vitor Sessak 16 years ago
parent
commit
27dbc47c05
2 changed files with 7 additions and 0 deletions
  1. +4
    -0
      libavformat/nutdec.c
  2. +3
    -0
      libavformat/nutenc.c

+ 4
- 0
libavformat/nutdec.c View File

@@ -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;
}


+ 3
- 0
libavformat/nutenc.c View File

@@ -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;
}


Loading…
Cancel
Save