summaryrefslogtreecommitdiff
path: root/libavformat/bink.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r--libavformat/bink.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 887f70a512..6db73cce3a 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -116,10 +116,8 @@ static int read_header(AVFormatContext *s)
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codec->codec_id = AV_CODEC_ID_BINKVIDEO;
- vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!vst->codec->extradata)
+ if (ff_alloc_extradata(vst->codec, 4))
return AVERROR(ENOMEM);
- vst->codec->extradata_size = 4;
avio_read(pb, vst->codec->extradata, 4);
bink->num_audio_tracks = avio_rl32(pb);
@@ -152,10 +150,8 @@ static int read_header(AVFormatContext *s)
ast->codec->channels = 1;
ast->codec->channel_layout = AV_CH_LAYOUT_MONO;
}
- ast->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
- if (!ast->codec->extradata)
+ if (ff_alloc_extradata(ast->codec, 4))
return AVERROR(ENOMEM);
- ast->codec->extradata_size = 4;
AV_WL32(ast->codec->extradata, vst->codec->codec_tag);
}