Commit 76f5dfbf authored by Luca Barbato's avatar Luca Barbato

westwood_vqa: do not free extradata on error in read_header

The extradata is already freed by avformat_open_input on
failure.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
parent c4abc909
...@@ -106,7 +106,6 @@ static int wsvqa_read_header(AVFormatContext *s) ...@@ -106,7 +106,6 @@ static int wsvqa_read_header(AVFormatContext *s)
header = (unsigned char *)st->codec->extradata; header = (unsigned char *)st->codec->extradata;
if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) != if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
VQA_HEADER_SIZE) { VQA_HEADER_SIZE) {
av_free(st->codec->extradata);
return AVERROR(EIO); return AVERROR(EIO);
} }
st->codec->width = AV_RL16(&header[6]); st->codec->width = AV_RL16(&header[6]);
...@@ -132,7 +131,6 @@ static int wsvqa_read_header(AVFormatContext *s) ...@@ -132,7 +131,6 @@ static int wsvqa_read_header(AVFormatContext *s)
* 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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment