summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-26 22:06:06 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-04-26 22:06:06 +0200
commit6f2ac3ee366a9b587abe9a72febc400ba5b98c24 (patch)
tree82693154727609333fc8df97dd7d76c2b1eee5ee /src/lib
parentc559c628539bc8956193a5ff8ac787a0c6fa090c (diff)
Fix negative shift left reported by UBSan (#757)
This shall have no performance impact on 2’s complement machine where the compiler replaces the multiplication by power of two (constant) by a left shift. Verified at least on MacOS Xcode 7.3, same assembly generated after fix.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/t1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c
index 108ce78b..8d020bb5 100644
--- a/src/lib/openjp2/t1.c
+++ b/src/lib/openjp2/t1.c
@@ -1514,7 +1514,7 @@ OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1,
if (tccp->qmfbid == 1) {
for (j = 0; j < cblk_h; ++j) {
for (i = 0; i < cblk_w; ++i) {
- tiledp[tileIndex] <<= T1_NMSEDEC_FRACBITS;
+ tiledp[tileIndex] *= 1 << T1_NMSEDEC_FRACBITS;
tileIndex++;
}
tileIndex += tileLineAdvance;