Author: akhaldi
Date: Tue Jun 7 10:24:56 2016
New Revision: 71573
URL:
http://svn.reactos.org/svn/reactos?rev=71573&view=rev
Log:
[MSRLE32] Sync with Wine Staging 1.9.11. CORE-11368
Modified:
trunk/reactos/dll/win32/msrle32/msrle32.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/msrle32/msrle32.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msrle32/msrle32.…
==============================================================================
--- trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msrle32/msrle32.c [iso-8859-1] Tue Jun 7 10:24:56 2016
@@ -1567,8 +1567,16 @@
size = lpbiIn->biSize;
- if (lpbiIn->biBitCount <= 8)
- size += lpbiIn->biClrUsed * sizeof(RGBQUAD);
+ if (lpbiIn->biBitCount <= 8) {
+ int colors;
+
+ if (lpbiIn->biClrUsed == 0)
+ colors = 1 << lpbiIn->biBitCount;
+ else
+ colors = lpbiIn->biClrUsed;
+
+ size += colors * sizeof(RGBQUAD);
+ }
if (lpbiOut != NULL) {
memcpy(lpbiOut, lpbiIn, size);
@@ -1647,27 +1655,33 @@
if (lpbiIn->biCompression != BI_RGB)
{
+ int colors;
+
+ if (lpbiIn->biBitCount <= 8 && lpbiIn->biClrUsed == 0)
+ colors = 1 << lpbiIn->biBitCount;
+ else
+ colors = lpbiIn->biClrUsed;
+
rgbIn = (const RGBQUAD*)((const BYTE*)lpbiIn + lpbiIn->biSize);
rgbOut = (const RGBQUAD*)((const BYTE*)lpbiOut + lpbiOut->biSize);
switch (lpbiOut->biBitCount) {
case 4:
case 8:
- pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed);
+ pi->palette_map = LocalAlloc(LPTR, colors);
if (pi->palette_map == NULL)
return ICERR_MEMORY;
- for (i = 0; i < lpbiIn->biClrUsed; i++) {
- pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(lpbiOut->biClrUsed,
rgbOut, rgbIn[i]);
- }
+ for (i = 0; i < colors; i++)
+ pi->palette_map[i] = MSRLE32_GetNearestPaletteIndex(colors, rgbOut,
rgbIn[i]);
break;
case 15:
case 16:
- pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * 2);
+ pi->palette_map = LocalAlloc(LPTR, colors * 2);
if (pi->palette_map == NULL)
return ICERR_MEMORY;
- for (i = 0; i < lpbiIn->biClrUsed; i++) {
+ for (i = 0; i < colors; i++) {
WORD color;
if (lpbiOut->biBitCount == 15)
@@ -1683,10 +1697,10 @@
break;
case 24:
case 32:
- pi->palette_map = LocalAlloc(LPTR, lpbiIn->biClrUsed * sizeof(RGBQUAD));
+ pi->palette_map = LocalAlloc(LPTR, colors * sizeof(RGBQUAD));
if (pi->palette_map == NULL)
return ICERR_MEMORY;
- memcpy(pi->palette_map, rgbIn, lpbiIn->biClrUsed * sizeof(RGBQUAD));
+ memcpy(pi->palette_map, rgbIn, colors * sizeof(RGBQUAD));
break;
};
}
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Jun 7 10:24:56 2016
@@ -121,7 +121,7 @@
reactos/dll/win32/msisys.ocx # Synced to WineStaging-1.9.4
reactos/dll/win32/msnet32 # Synced to WineStaging-1.9.4
reactos/dll/win32/mspatcha # Synced to WineStaging-1.9.4
-reactos/dll/win32/msrle32 # Synced to WineStaging-1.9.4
+reactos/dll/win32/msrle32 # Synced to WineStaging-1.9.11
reactos/dll/win32/mssign32 # Synced to WineStaging-1.9.4
reactos/dll/win32/mssip32 # Synced to WineStaging-1.9.4
reactos/dll/win32/mstask # Synced to WineStaging-1.9.4