summaryrefslogtreecommitdiff
path: root/libopenjpeg
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2010-10-07 17:45:04 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2010-10-07 17:45:04 +0000
commitcc01949777e56db1cb1bb2fd3809e2963da6efa3 (patch)
treeae35c816346b5bf858fb7017962ae22336ac6f8d /libopenjpeg
parent287be4e6832bca03d00e4e83bd6439129b54dff3 (diff)
The original v1.3 branch had:
((int*)tiledp)[(j * tile_w) + i] = tmp / 2; while v2 had: ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp >> 1; Divide by two and a right shift operation are only equivalent when the data is unsigned. In this case the data is signed, so the right shift operation is incorrectly clearing the sign bit. Patch from: Sheet Spotter
Diffstat (limited to 'libopenjpeg')
-rw-r--r--libopenjpeg/t1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopenjpeg/t1.c b/libopenjpeg/t1.c
index 139ff48e..dd11d694 100644
--- a/libopenjpeg/t1.c
+++ b/libopenjpeg/t1.c
@@ -1264,7 +1264,7 @@ void t1_decode_cblks(
for (j = 0; j < cblk_h; ++j) {
for (i = 0; i < cblk_w; ++i) {
OPJ_INT32 tmp = datap[(j * cblk_w) + i];
- ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp >> 1;
+ ((OPJ_INT32*)tiledp)[(j * tile_w) + i] = tmp / 2;
}
}
} else { /* if (tccp->qmfbid == 0) */