mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 05:58:13 +00:00
[GDI32] SetBkMode: Avoid invalid input. CORE-19656 (#7089)
Fixes a bug in Midori 0.5.11 installer which caused bad rendering that was making the text hard to read (no background). In Windows it's visible as FillRect(0x89011a1f, 0x0019f87c, 0xabababab), and in ReactOS as SetBkMode(0xb5010fce, -1546139919). After a number of attempts to get the same behavior, I haven't found a way to fix it without a hack to make the installer look identical to Windows. At least I added handling for the incorrect value in SetBkMode. This shouldn't matter anywhere. It may not look the same as on Windows, but the text will at least be readable.
This commit is contained in:
parent
4da2e78319
commit
a9bdd62d84
1 changed files with 7 additions and 0 deletions
|
@ -1060,6 +1060,13 @@ SetBkMode(
|
|||
PDC_ATTR pdcattr;
|
||||
INT iOldMode;
|
||||
|
||||
/* Avoid bad mode setting */
|
||||
if ((iBkMode != TRANSPARENT) && (iBkMode != OPAQUE))
|
||||
{
|
||||
DPRINT1("SetBkMode: Incorrect value\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
HANDLE_METADC(INT, SetBkMode, 0, hdc, iBkMode);
|
||||
|
||||
/* Get the DC attribute */
|
||||
|
|
Loading…
Reference in a new issue