]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/pcm.c
lcl: return negative error codes on decode_init() errors.
[ffmpeg] / libavcodec / pcm.c
index 1adaf7031849a6a35e83add95a5f08a257f3f17c..d0407453de2281a5374e8b9002f98c5ba0d04eb8 100644 (file)
@@ -49,7 +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();
-    avctx->coded_frame->key_frame= 1;
+    if (!avctx->coded_frame)
+        return AVERROR(ENOMEM);
 
     return 0;
 }
@@ -193,7 +194,6 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         return -1;
     }
 
-    avpkt->size = frame->nb_samples * avctx->channels * sample_size;
     *got_packet_ptr = 1;
     return 0;
 }