2 Nov
2021
2 Nov
'21
12:58 a.m.
On Tue, Nov 2, 2021 at 6:34 AM Jacek Caban <jacek(a)codeweavers.com> wrote:
On 11/1/21 6:31 AM, Jinoh Kang wrote:
+ UINT elm_size = coloruse == DIB_PAL_COLORS ? sizeof(WORD) : sizeof(DWORD); + UINT colours = dst->biClrUsed; + + if (colours > UINT_MAX / elm_size) + return FALSE;
Should we use at most 1 << bpp entries here?
Windows is happy with whatever size is requested for the palette, even if it's > (1<<bpp). In fact, setting a large colour table size results in OOM. To replicate this behavior, I set the limit to the maximum possible with the current implementation.
Thanks,
Jacek