summaryrefslogtreecommitdiff
path: root/libavcodec/roqvideoenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-13 15:14:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-13 15:14:27 +0100
commit295b79b5d8c0cf0a9691f8d6b512aa1e289d528d (patch)
tree7687012a71db2ce95a4d08087c5c88663ae82734 /libavcodec/roqvideoenc.c
parent88a46fa8c9e5b9aeefbd1a82dcb1a18e0f1e8b7b (diff)
downloadffmpeg-295b79b5d8c0cf0a9691f8d6b512aa1e289d528d.tar.gz
avcodec/roqvideoenc: Check for av_malloc_array() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/roqvideoenc.c')
-rw-r--r--libavcodec/roqvideoenc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
index 2f8e122a8e..731916f4d2 100644
--- a/libavcodec/roqvideoenc.c
+++ b/libavcodec/roqvideoenc.c
@@ -1042,6 +1042,12 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->last_motion8 =
av_malloc_array ((enc->width*enc->height/64), sizeof(motion_vect));
+ if (!enc->tmpData || !enc->this_motion4 || !enc->last_motion4 ||
+ !enc->this_motion8 || !enc->last_motion8) {
+ roq_encode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
+
return 0;
}