]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pcm.c
lcl: return negative error codes on decode_init() errors.
[ffmpeg] / libavcodec / pcm.c
index 2e0b5ec4b0c1eeb800b6c7dd37cc8e38b099a55c..d0407453de2281a5374e8b9002f98c5ba0d04eb8 100644 (file)
@@ -49,6 +49,8 @@ static av_cold int pcm_encode_init(AVCodecContext *avctx)
     avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
     avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
     avctx->coded_frame= avcodec_alloc_frame();
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     return 0;
 }