ttaenc: fix packet size
authorPaul B Mahol <onemda@gmail.com>
Fri, 2 Aug 2013 16:45:58 +0000 (16:45 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 10 Aug 2013 00:01:40 +0000 (02:01 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit bc2187cfdb5eeb82e3caf42a81a00d1ee4c16d8e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ttaenc.c

index c77e0c2..55599cc 100644 (file)
@@ -116,7 +116,7 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     PutBitContext pb;
     int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0;
 
-    if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * s->bps)) < 0)
+    if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps)) < 0)
         return ret;
     init_put_bits(&pb, avpkt->data, avpkt->size);