Skip to content
Snippets Groups Projects
Commit 295b79b5 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/roqvideoenc: Check for av_malloc_array() failure

parent 88a46fa8
No related branches found
No related tags found
No related merge requests found
...@@ -1042,6 +1042,12 @@ static av_cold int roq_encode_init(AVCodecContext *avctx) ...@@ -1042,6 +1042,12 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
enc->last_motion8 = enc->last_motion8 =
av_malloc_array ((enc->width*enc->height/64), sizeof(motion_vect)); 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; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment