avcodec/pcm: Better min_size for ff_alloc_packet2()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 3 Aug 2015 12:06:28 +0000 (14:06 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 3 Aug 2015 12:31:03 +0000 (14:31 +0200)
33318 -> 30601 decicycles

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pcm.c

index 81d9f92..2cb5a36 100644 (file)
@@ -97,7 +97,7 @@ static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     n           = frame->nb_samples * avctx->channels;
     samples     = (const short *)frame->data[0];
 
-    if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size, 0)) < 0)
+    if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size, n * sample_size)) < 0)
         return ret;
     dst = avpkt->data;