-
Notifications
You must be signed in to change notification settings - Fork 468
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mayeut
Author
Collaborator
|
||
tileIndex++; | ||
} | ||
tileIndex += tileLineAdvance; | ||
|
1 comment
on commit 6f2ac3e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Should there be brackets around the right hand side of the equation? for clarity ?
(1 << T1_NMSEDEC_FRACBITS)