summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-05-22 11:56:18 +0000
committerPaul B Mahol <onemda@gmail.com>2012-05-22 11:56:18 +0000
commit672f8226bbe37d3328731e7f5093e0b00c35ae54 (patch)
treeb7cb517044368053b1f1fe119124298debcd1ce7 /libavcodec/shorten.c
parent27127ebe6cd5ced73717edc22275e50368677148 (diff)
shorten: fix lossy decoding
Closes #1299, #1300 and #1301. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c2
1 files changed, 1 insertions, 1 deletions
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 */