[PATCH v5 6/7] gdi32: allow passing BITMAPINFO with bmiHeader.biSizeImage == 0 for EMF DC.

Jin-oh Kang jinoh.kang.kr at gmail.com
Mon Nov 1 19:58:13 CDT 2021


On Tue, Nov 2, 2021 at 6:34 AM Jacek Caban <jacek at 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
>



More information about the wine-devel mailing list