summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
diff options
context:
space:
mode:
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;
}