From fba418e6708a5271e933be27f346759e3d616e7c Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 3 May 2011 01:02:07 +0200 Subject: [PATCH] Do not assume AV_SAMPLE_FMT_S16 as tta sample format. --- libavcodec/tta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 3367788633..217354c863 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -325,7 +325,7 @@ static int tta_decode_frame(AVCodecContext *avctx, int cur_chan = 0, framelen = s->frame_length; int32_t *p; - if (*data_size < (framelen * s->channels * 2)) { + if (*data_size < (framelen * s->channels * av_get_bits_per_sample_fmt(avctx->sample_fmt) / 8)) { av_log(avctx, AV_LOG_ERROR, "Output buffer size is too small.\n"); return -1; }