1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-10-30 23:18:11 +02:00

avcodec/roqvideoenc: Check for av_malloc_array() failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2015-01-13 15:14:27 +01:00
parent 88a46fa8c9
commit 295b79b5d8

View File

@@ -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;
}