[0.4.12][NTGDI] Fix potential BSOD 0x1E CORE-17626
authorJoachim Henze <Joachim.Henze@reactos.org>
Mon, 15 Nov 2021 11:06:59 +0000 (12:06 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Mon, 15 Nov 2021 11:06:59 +0000 (12:06 +0100)
commit389026830254d2bb8e6ed45c70c763b52c5c9256
treecc341e061faa1fe3d90a0e3a1c58e0348da25788
parentfaebee8384bb90e1b16a297717ef6e427283be51
[0.4.12][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