summaryrefslogtreecommitdiff
path: root/ffmpeg/libavformat/bink.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavformat/bink.c')
-rw-r--r--ffmpeg/libavformat/bink.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ffmpeg/libavformat/bink.c b/ffmpeg/libavformat/bink.c
index 887f70a..95b615a 100644
--- a/ffmpeg/libavformat/bink.c
+++ b/ffmpeg/libavformat/bink.c
@@ -116,11 +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_get_extradata(vst->codec, pb, 4) < 0)
return AVERROR(ENOMEM);
- vst->codec->extradata_size = 4;
- avio_read(pb, vst->codec->extradata, 4);
bink->num_audio_tracks = avio_rl32(pb);
@@ -152,10 +149,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);
}