# HG changeset patch # User conrad # Date 1279264831 0 # Node ID 7501f327cfd1968e08dccb28890d76e233666889 # Parent b246b214c2e9de23f4ec597f5a50fded6ea46c77 vp8: Check for malloc failure diff -r b246b214c2e9 -r 7501f327cfd1 vp8.c --- a/vp8.c Thu Jul 15 23:02:34 2010 +0000 +++ b/vp8.c Fri Jul 16 07:20:31 2010 +0000 @@ -225,6 +225,9 @@ s->intra4x4_pred_mode_base = av_mallocz(s->b4_stride*(4*s->mb_height+1)); s->top_nnz = av_mallocz(s->mb_width*sizeof(*s->top_nnz)); + if (!s->macroblocks_base || !s->intra4x4_pred_mode_base || !s->top_nnz) + return AVERROR(ENOMEM); + s->macroblocks = s->macroblocks_base + 1 + s->mb_stride; s->intra4x4_pred_mode = s->intra4x4_pred_mode_base + 4 + s->b4_stride;