Commit 5a831151 authored by Michael Niedermayer's avatar Michael Niedermayer

ffv1: check for malloc failure

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b77d94dc
...@@ -123,6 +123,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f) ...@@ -123,6 +123,10 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
int sxe = f->avctx->width * (sx + 1) / f->num_h_slices; int sxe = f->avctx->width * (sx + 1) / f->num_h_slices;
int sys = f->avctx->height * sy / f->num_v_slices; int sys = f->avctx->height * sy / f->num_v_slices;
int sye = f->avctx->height * (sy + 1) / f->num_v_slices; int sye = f->avctx->height * (sy + 1) / f->num_v_slices;
if (!fs)
return AVERROR(ENOMEM);
f->slice_context[i] = fs; f->slice_context[i] = fs;
memcpy(fs, f, sizeof(*fs)); memcpy(fs, f, sizeof(*fs));
memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2)); memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment