ffv1: check for malloc failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/9/head
Michael Niedermayer 12 years ago
parent b77d94dc6c
commit 5a83115130
  1. 4
      libavcodec/ffv1.c

@ -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 sys = f->avctx->height * sy / 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;
memcpy(fs, f, sizeof(*fs));
memset(fs->rc_stat2, 0, sizeof(fs->rc_stat2));

Loading…
Cancel
Save