Fixed undefined behaviour in ncrush
authorakallabeth <akallabeth@posteo.net>
Fri, 15 May 2020 13:43:33 +0000 (15:43 +0200)
committerakallabeth <akallabeth@posteo.net>
Mon, 18 May 2020 15:10:01 +0000 (17:10 +0200)
(cherry picked from commit 83137d2a1bb732fbea2f20778924a50a79f63fef)

libfreerdp/codec/ncrush.c

index af503fc..3d6a216 100644 (file)
@@ -1926,9 +1926,9 @@ static INLINE UINT16 get_word(const BYTE* data)
 static INLINE UINT32 get_dword(const BYTE* data)
 {
        UINT32 tmp = *data++;
-       tmp |= *data++ << 8U;
-       tmp |= *data++ << 16U;
-       tmp |= *data++ << 24U;
+       tmp |= (UINT32)*data++ << 8U;
+       tmp |= (UINT32)*data++ << 16U;
+       tmp |= (UINT32)*data++ << 24U;
        return tmp;
 }