aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-10-13 10:30:59 +0000
committerPaul B Mahol <onemda@gmail.com>2013-10-13 20:13:38 +0000
commita807c68253b02cce8b9fbc87d7857c31d531a1ee (patch)
treee4097d5fd4a2cf8dc03c6f97ebfadc4d20ce8ac2 /libavformat/avidec.c
parent3fd79833e266aec2d77cf07092e8b1406fd307d4 (diff)
downloadffmpeg-a807c68253b02cce8b9fbc87d7857c31d531a1ee.tar.gz
avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 44ab9d9a3f..1a40e94c82 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -648,12 +648,8 @@ static int avi_read_header(AVFormatContext *s)
st->codec->extradata_size = esize - 10 * 4;
} else
st->codec->extradata_size = size - 10 * 4;
- st->codec->extradata = av_malloc(st->codec->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata) {
- st->codec->extradata_size = 0;
+ if (ff_alloc_extradata(st->codec, st->codec->extradata_size))
return AVERROR(ENOMEM);
- }
avio_read(pb,
st->codec->extradata,
st->codec->extradata_size);
@@ -781,12 +777,8 @@ static int avi_read_header(AVFormatContext *s)
st = s->streams[stream_index];
if (size<(1<<30)) {
- st->codec->extradata_size= size;
- st->codec->extradata= av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata) {
- st->codec->extradata_size= 0;
+ if (ff_alloc_extradata(st->codec, size))
return AVERROR(ENOMEM);
- }
avio_read(pb, st->codec->extradata, st->codec->extradata_size);
}