From a807c68253b02cce8b9fbc87d7857c31d531a1ee Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 13 Oct 2013 10:30:59 +0000 Subject: avformat: use ff_alloc_extradata() Signed-off-by: Paul B Mahol --- libavformat/riffdec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libavformat/riffdec.c') diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index e7c52e0..de8eb5f 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -115,12 +115,9 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) cbSize -= 22; size -= 22; } - codec->extradata_size = cbSize; if (cbSize > 0) { av_free(codec->extradata); - codec->extradata = av_mallocz(codec->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); - if (!codec->extradata) + if (ff_alloc_extradata(codec, cbSize)) return AVERROR(ENOMEM); avio_read(pb, codec->extradata, codec->extradata_size); size -= cbSize; -- cgit v1.1