From 5a8311513091ea7277578fbaf189e460dd1d4c7d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 5 Feb 2013 00:22:29 +0100 Subject: ffv1: check for malloc failure Signed-off-by: Michael Niedermayer --- libavcodec/ffv1.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index 074be4cfbb..29d76ed62e 100644 --- a/libavcodec/ffv1.c +++ b/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)); -- cgit v1.2.3