diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-10-13 10:30:59 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-10-13 20:13:38 +0000 |
commit | a807c68253b02cce8b9fbc87d7857c31d531a1ee (patch) | |
tree | e4097d5fd4a2cf8dc03c6f97ebfadc4d20ce8ac2 /libavformat/westwood_vqa.c | |
parent | 3fd79833e266aec2d77cf07092e8b1406fd307d4 (diff) |
avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/westwood_vqa.c')
-rw-r--r-- | libavformat/westwood_vqa.c | 8 |
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; |