[0.4.13][NTGDI] Fix potential BSOD 0x1E CORE-17626
authorJoachim Henze <Joachim.Henze@reactos.org>
Mon, 15 Nov 2021 11:06:27 +0000 (12:06 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Mon, 15 Nov 2021 11:06:27 +0000 (12:06 +0100)
commitaa42c29c1cdd2ee99c3c411871b3321e89db2f99
treebe531da78e71615631a4d7f6907a9d0e55a5c3a6
parent3e5ddcf1d1983ca82e098a507c749012ad2febe2
[0.4.13][NTGDI] Fix potential BSOD 0x1E CORE-17626

in CreateDIBPalette() when passing invalid arguments to CreateDIBSection.
This could be triggered by using the broken test-application "GDIProg".

After this patch not only the BSOD is fixed but also the app does
properly start up, like it is the case on 2k3sp2.

The problem was unhidden by the innocent and unrelated 0.4.12-dev-266-g 8ab3652c0112d152ba87ea10db15a6837dc89e94
I was not able to trigger the bug in releases older than 0.4.12,
but it is rather obvious that the mentioned revision is not really 'guilty', which
is why I will port the fix back further into releases even older than 0.4.12 as well.

Thanks to the patches author Doug Lyons.

a squashed port of:
0.4.15-dev-2734-g 514147776a7e70636911033ab6c89779b2c8ee1e (fixes the BSOD)
0.4.15-dev-2775-g c596fd3ef6933c9eec95a47c807d01d3776bbcc0 (improvement #3758)
0.4.15-dev-2776-g 4130f0b1c5f869614c71818bb7c30447d894afc8 (compilation fix)
and some white-space tweaking that was committed after those.
win32ss/gdi/ntgdi/dibobj.c