diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-18 15:58:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-18 15:59:45 +0200 |
commit | 6e8fe448154e1aa0928cb0d2e1aecb7255c751cc (patch) | |
tree | fae5081b13e1ea7153ffe030c7f787d39d21c362 | |
parent | 5441eb460cb4b52eaf4bc440146c5e458edbea05 (diff) | |
download | ffmpeg-6e8fe448154e1aa0928cb0d2e1aecb7255c751cc.tar.gz |
avcodec/wmv2enc: allocate padding for extradata and check malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/wmv2enc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 6aeee59ab2..869b3c7fe4 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -60,7 +60,9 @@ static av_cold int wmv2_encode_init(AVCodecContext *avctx){ ff_wmv2_common_init(w); avctx->extradata_size= 4; - avctx->extradata= av_mallocz(avctx->extradata_size + 10); + avctx->extradata= av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!avctx->extradata) + return AVERROR(ENOMEM); encode_ext_header(w); return 0; |