summaryrefslogtreecommitdiff
path: root/libavformat/4xm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-18 13:09:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-18 13:10:24 +0200
commit6a510909242a48027dd3ed88b8844d339d17a1de (patch)
treeb5e2ce839e63622944379b9213ff321bf39a7cc7 /libavformat/4xm.c
parent68c05185e229b093bf5c2236c2883cbc296ea938 (diff)
parentd256ed78ffe202a4dcc8d625becffc716bfa3977 (diff)
Merge commit 'd256ed78ffe202a4dcc8d625becffc716bfa3977'
* commit 'd256ed78ffe202a4dcc8d625becffc716bfa3977': 4xm: allocate extradata properly. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r--libavformat/4xm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 23279c42fb..0b4ddfabf2 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -110,8 +110,11 @@ static int parse_vtrk(AVFormatContext *s,
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = AV_CODEC_ID_4XM;
+
+ st->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!st->codec->extradata)
+ return AVERROR(ENOMEM);
st->codec->extradata_size = 4;
- st->codec->extradata = av_malloc(4);
AV_WL32(st->codec->extradata, AV_RL32(buf + 16));
st->codec->width = AV_RL32(buf + 36);
st->codec->height = AV_RL32(buf + 40);