pcm: check return value of avcodec_alloc_frame()
authorPaul B Mahol <onemda@gmail.com>
Sat, 28 Jan 2012 20:06:36 +0000 (20:06 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 28 Jan 2012 21:08:20 +0000 (22:08 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/pcm.c

index 6500037..f69bb1e 100644 (file)
@@ -50,6 +50,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
     avctx->coded_frame= avcodec_alloc_frame();
     avctx->coded_frame->key_frame= 1;
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     return 0;
 }