mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[core,orders] shift unsigned value
The delta value read is signed, but the operations are done on an unsigned.
This commit is contained in:
@@ -797,9 +797,11 @@ static INLINE BOOL update_write_4byte_unsigned(wStream* s, UINT32 value)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static INLINE BOOL update_read_delta(wStream* s, INT32* value)
|
||||
{
|
||||
BYTE byte = 0;
|
||||
UINT32 uvalue = 0;
|
||||
|
||||
if (!Stream_CheckAndLogRequiredLength(TAG, s, 1))
|
||||
return FALSE;
|
||||
@@ -807,9 +809,9 @@ static INLINE BOOL update_read_delta(wStream* s, INT32* value)
|
||||
Stream_Read_UINT8(s, byte);
|
||||
|
||||
if (byte & 0x40)
|
||||
*value = (byte | ~0x3F);
|
||||
uvalue = (byte | ~0x3F);
|
||||
else
|
||||
*value = (byte & 0x3F);
|
||||
uvalue = (byte & 0x3F);
|
||||
|
||||
if (byte & 0x80)
|
||||
{
|
||||
@@ -817,8 +819,9 @@ static INLINE BOOL update_read_delta(wStream* s, INT32* value)
|
||||
return FALSE;
|
||||
|
||||
Stream_Read_UINT8(s, byte);
|
||||
*value = (*value << 8) | byte;
|
||||
uvalue = (uvalue << 8) | byte;
|
||||
}
|
||||
*value = (INT32)uvalue;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user