From 672f8226bbe37d3328731e7f5093e0b00c35ae54 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 22 May 2012 11:56:18 +0000 Subject: [PATCH] shorten: fix lossy decoding Closes #1299, #1300 and #1301. Signed-off-by: Paul B Mahol --- libavcodec/shorten.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index b211e4f140..a0b371dc92 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -539,7 +539,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data, sum += s->offset[channel][i]; coffset = sum / s->nmean; if (s->version >= 2) - coffset >>= FFMIN(1, s->bitshift); + coffset = s->bitshift == 0 ? coffset : coffset >> s->bitshift - 1 >> 1; } /* decode samples for this channel */