Skip to content

Commit 231294f

Browse files
committed
mmcmp: fix big-endian 16-bit conversion (store the converted value in little-endian order.)
1 parent 0a6c8bd commit 231294f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mmcmp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ BOOL MMCMP_Unpack(LPCBYTE *ppMemFile, LPDWORD pdwMemLength)
275275
{
276276
newval ^= 0x8000;
277277
}
278-
pDest[dwPos++] = (WORD)newval;
278+
WORD swapped = (WORD)newval;
279+
pDest[dwPos++] = bswapLE16(swapped);
279280
}
280281
if (dwPos >= dwSize)
281282
{

0 commit comments

Comments
 (0)