From bc2187cfdb5eeb82e3caf42a81a00d1ee4c16d8e Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Fri, 2 Aug 2013 16:45:58 +0000
Subject: [PATCH] ttaenc: fix packet size

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/ttaenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c
index c77e0c29b0b..55599cc525a 100644
--- a/libavcodec/ttaenc.c
+++ b/libavcodec/ttaenc.c
@@ -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);
 
-- 
GitLab