summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.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/flvdec.c
parent3fd79833e266aec2d77cf07092e8b1406fd307d4 (diff)
avformat: use ff_alloc_extradata()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r--libavformat/flvdec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index d81a70b93b..d259927a84 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -246,9 +246,7 @@ static int flv_set_video_codec(AVFormatContext *s, AVStream *vstream,
vcodec->codec_id = AV_CODEC_ID_VP6A;
if (read) {
if (vcodec->extradata_size != 1) {
- vcodec->extradata = av_malloc(1 + FF_INPUT_BUFFER_PADDING_SIZE);
- if (vcodec->extradata)
- vcodec->extradata_size = 1;
+ ff_alloc_extradata(vcodec, 1);
}
if (vcodec->extradata)
vcodec->extradata[0] = avio_r8(s->pb);
@@ -616,10 +614,8 @@ static int flv_read_close(AVFormatContext *s)
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
{
av_free(st->codec->extradata);
- st->codec->extradata = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!st->codec->extradata)
+ if (ff_alloc_extradata(st->codec, size))
return AVERROR(ENOMEM);
- st->codec->extradata_size = size;
avio_read(s->pb, st->codec->extradata, st->codec->extradata_size);
return 0;
}