frwu: check if allocation was successful
authorPaul B Mahol <onemda@gmail.com>
Fri, 27 Jan 2012 01:13:48 +0000 (01:13 +0000)
committerRonald S. Bultje <rsbultje@gmail.com>
Fri, 27 Jan 2012 01:31:06 +0000 (09:31 +0800)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
libavcodec/frwu.c

index 061c460..eba0530 100644 (file)
@@ -33,6 +33,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
     avctx->pix_fmt = PIX_FMT_UYVY422;
 
     avctx->coded_frame = avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     return 0;
 }