Skip to content
Snippets Groups Projects
Commit 527b46ba authored by Reimar Döffinger's avatar Reimar Döffinger
Browse files

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
parent 6de5b7c6
No related branches found
No related tags found
Loading
...@@ -252,6 +252,8 @@ static void adjust_write_index(AVFormatContext *s) ...@@ -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) static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
{ {
FFMContext *ffm = s->priv_data; FFMContext *ffm = s->priv_data;
...@@ -381,12 +383,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) ...@@ -381,12 +383,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
ffm->first_packet = 1; ffm->first_packet = 1;
return 0; return 0;
fail: fail:
for(i=0;i<s->nb_streams;i++) { ffm_close(s);
st = s->streams[i];
if (st) {
av_free(st);
}
}
return -1; return -1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment