summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/opj_intmath.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/openjp2/opj_intmath.h')
-rw-r--r--src/lib/openjp2/opj_intmath.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/openjp2/opj_intmath.h b/src/lib/openjp2/opj_intmath.h
index 8fa89c03..188a09a7 100644
--- a/src/lib/openjp2/opj_intmath.h
+++ b/src/lib/openjp2/opj_intmath.h
@@ -87,7 +87,7 @@ static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b) {
*/
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b) {
OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
- return -(OPJ_UINT32)(sum >> 32) | (OPJ_UINT32)sum;
+ return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
}
/**