Browse Source

avcodec/mationpixels: check for malloc failures

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.1
Piotr Bandurski Michael Niedermayer 12 years ago
parent
commit
8728360b56
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/motionpixels.c

+ 2
- 0
libavcodec/motionpixels.c View File

@@ -68,6 +68,8 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1;
mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel));
mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel));
if (!mp->changes_map || !mp->vpt || !mp->hpt)
return AVERROR(ENOMEM);
avctx->pix_fmt = AV_PIX_FMT_RGB555;
avcodec_get_frame_defaults(&mp->frame);
return 0;


Loading…
Cancel
Save