vqa: fix double free on corrupted streams

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3123856c7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Laurent Aimar 2011-10-08 23:40:37 +02:00 committed by Michael Niedermayer
parent 2fdbc1d553
commit b832e539c0
1 changed files with 1 additions and 3 deletions

View File

@ -277,10 +277,8 @@ static int wsvqa_read_header(AVFormatContext *s,
/* there are 0 or more chunks before the FINF chunk; iterate until /* there are 0 or more chunks before the FINF chunk; iterate until
* FINF has been skipped and the file will be ready to be demuxed */ * FINF has been skipped and the file will be ready to be demuxed */
do { do {
if (avio_read(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE) { if (avio_read(pb, scratch, VQA_PREAMBLE_SIZE) != VQA_PREAMBLE_SIZE)
av_free(st->codec->extradata);
return AVERROR(EIO); return AVERROR(EIO);
}
chunk_tag = AV_RB32(&scratch[0]); chunk_tag = AV_RB32(&scratch[0]);
chunk_size = AV_RB32(&scratch[4]); chunk_size = AV_RB32(&scratch[4]);