ffv1enc: check for malloc failure

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/9/head
Michael Niedermayer 12 years ago
parent 0e2b0033f1
commit b77d94dc6c
  1. 2
      libavcodec/ffv1enc.c

@ -896,6 +896,8 @@ slices_ok:
#define STATS_OUT_SIZE 1024 * 1024 * 6 #define STATS_OUT_SIZE 1024 * 1024 * 6
if (avctx->flags & CODEC_FLAG_PASS1) { if (avctx->flags & CODEC_FLAG_PASS1) {
avctx->stats_out = av_mallocz(STATS_OUT_SIZE); avctx->stats_out = av_mallocz(STATS_OUT_SIZE);
if (!avctx->stats_out)
return AVERROR(ENOMEM);
for (i = 0; i < s->quant_table_count; i++) for (i = 0; i < s->quant_table_count; i++)
for (j = 0; j < s->slice_count; j++) { for (j = 0; j < s->slice_count; j++) {
FFV1Context *sf = s->slice_context[j]; FFV1Context *sf = s->slice_context[j];

Loading…
Cancel
Save