[Scummvm-git-logs] scummvm master -> d623ec2c38e62567525cc84554a3fd7c4e3bfef4

sev- sev at scummvm.org
Thu Mar 22 22:16:27 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d623ec2c38 COMMON: Fix UB, left shift of negative value


Commit: d623ec2c38e62567525cc84554a3fd7c4e3bfef4
    https://github.com/scummvm/scummvm/commit/d623ec2c38e62567525cc84554a3fd7c4e3bfef4
Author: Adrian Frühwirth (bonki at users.noreply.github.com)
Date: 2018-03-22T22:16:24+01:00

Commit Message:
COMMON: Fix UB, left shift of negative value

Changed paths:
    common/dcl.cpp


diff --git a/common/dcl.cpp b/common/dcl.cpp
index 75a533a..7c2fc2c 100644
--- a/common/dcl.cpp
+++ b/common/dcl.cpp
@@ -98,7 +98,7 @@ uint32 DecompressorDCL::getBitsLSB(int n) {
 	// Fetching more data to buffer if needed
 	if (_nBits < n)
 		fetchBitsLSB();
-	uint32 ret = (_dwBits & ~((~0) << n));
+	uint32 ret = (_dwBits & ~(~0UL << n));
 	_dwBits >>= n;
 	_nBits -= n;
 	return ret;





More information about the Scummvm-git-logs mailing list