diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-25 11:52:58 +0400 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-07-25 11:52:58 +0400 |
commit | 527b46ba26124e51526d643c5e0f41c8160f286c (patch) | |
tree | b4d3318fcf502078d50ad48e89a6ffd7a8a9a340 /libavformat/ffmdec.c | |
parent | 6de5b7c6b82735e175c1e5ba9ae998af1e3e8443 (diff) |
ffmdec: Do not manually free streams on read_header error, this is always
handled by upper layers.
Fixes double-frees (issue 2003).
Instead call ffm_close to ensure rc_eqs are freed also in the error case.
Originally committed as revision 24490 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/ffmdec.c')
-rw-r--r-- | libavformat/ffmdec.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index b2a4bc20fb..33301e677e 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -252,6 +252,8 @@ static void adjust_write_index(AVFormatContext *s) } +static int ffm_close(AVFormatContext *s); + static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) { FFMContext *ffm = s->priv_data; @@ -381,12 +383,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) ffm->first_packet = 1; return 0; fail: - for(i=0;i<s->nb_streams;i++) { - st = s->streams[i]; - if (st) { - av_free(st); - } - } + ffm_close(s); return -1; } |