aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-13 02:24:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-13 12:44:37 +0200
commitf57119b8e58cb5437c3ab40d797293ecb9b4a894 (patch)
tree1c621704c0e7755bc05170655841595012f978f1 /libavcodec/jpeg2000dec.c
parentdc072c98677fde8d716e20e70b147989aac232e1 (diff)
downloadffmpeg-f57119b8e58cb5437c3ab40d797293ecb9b4a894.tar.gz
jpeg2000: fix overflow in dequantization
Fixes decoding of file generated with: ffmpeg -f lavfi -i smptehdbars=hd720 -pix_fmt rgb48 /tmp/o.jp2 Reviewed-by: Nicolas BERTRAND <nicoinattendu@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dec.c')
-rw-r--r--libavcodec/jpeg2000dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index e2a9a95f3e..d9b9888382 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1024,7 +1024,7 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
int *src = t1->data[j];
for (i = 0; i < w; ++i)
- datap[i] = (src[i] * band->i_stepsize + (1 << 15)) >> 16;
+ datap[i] = (src[i] * band->i_stepsize + (1 << 14)) >> 15;
}
}