summaryrefslogtreecommitdiff
path: root/libavformat/westwood_vqa.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/westwood_vqa.c')
-rw-r--r--libavformat/westwood_vqa.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c
index d8791da131..2e72928a4c 100644
--- a/libavformat/westwood_vqa.c
+++ b/libavformat/westwood_vqa.c
@@ -101,10 +101,8 @@ static int wsvqa_read_header(AVFormatContext *s)
avio_seek(pb, 20, SEEK_SET);
/* the VQA header needs to go to the decoder */
- st->codec->extradata = av_mallocz(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata)
+ if (ff_alloc_extradata(st->codec, VQA_HEADER_SIZE))
return AVERROR(ENOMEM);
- st->codec->extradata_size = VQA_HEADER_SIZE;
header = (unsigned char *)st->codec->extradata;
if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
VQA_HEADER_SIZE) {
@@ -221,9 +219,7 @@ static int wsvqa_read_packet(AVFormatContext *s,
break;
case SND2_TAG:
st->codec->codec_id = AV_CODEC_ID_ADPCM_IMA_WS;
- st->codec->extradata_size = 2;
- st->codec->extradata = av_mallocz(2 + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata)
+ if (ff_alloc_extradata(st->codec, 2))
return AVERROR(ENOMEM);
AV_WL16(st->codec->extradata, wsvqa->version);
break;