wtvdec: fix memleak on error

Fixes CID718002
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-13 02:37:47 +02:00
parent 120b38b966
commit e47024d72f
1 changed files with 3 additions and 1 deletions

View File

@ -580,8 +580,10 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code
if (!wst) if (!wst)
return NULL; return NULL;
st = avformat_new_stream(s, NULL); st = avformat_new_stream(s, NULL);
if (!st) if (!st) {
av_free(wst);
return NULL; return NULL;
}
st->id = sid; st->id = sid;
st->priv_data = wst; st->priv_data = wst;
} }