# HG changeset patch # User reimar # Date 1280044378 0 # Node ID 024f95630898d754cea490ef2321853dfa9644ca # Parent 2b1ab404f1cf1a6343ead29e1cee2be094a9795d 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. diff -r 2b1ab404f1cf -r 024f95630898 ffmdec.c --- a/ffmdec.c Sat Jul 24 22:50:12 2010 +0000 +++ b/ffmdec.c Sun Jul 25 07:52:58 2010 +0000 @@ -252,6 +252,8 @@ } +static int ffm_close(AVFormatContext *s); + static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) { FFMContext *ffm = s->priv_data; @@ -381,12 +383,7 @@ ffm->first_packet = 1; return 0; fail: - for(i=0;inb_streams;i++) { - st = s->streams[i]; - if (st) { - av_free(st); - } - } + ffm_close(s); return -1; }