LoadImage (4bpp) / CopyImage() crashing

Cyril Margorin comargo at gmail.com
Fri Dec 9 16:12:23 CST 2005


Hello,

Could anyone tell me, why function CopyImage uses
GetBitmapBits/SetBitmapBits, while MSDN marks these function as
absolete?

I've tried to move from GetBitmapBits/SetBitmapBits to
GetDIBits/SetDIBits. It seems to me that this way is correct, if keep
in mind, that GetBitmapBits is wrong.

In attachment you may find a patch for it.

Am I wrong somewhere?

2005/11/25, Cyril Margorin <comargo at gmail.com>:
> Hello,
>
> During research the crashing application I've found a problem that can
> be easily reproduced by test.
> (http://www.winehq.org/pipermail/wine-patches/2005-November/022384.html)
>
> By investigation of problem I've found that original DIB bit depth is
> 4bpp, Physical pixmap bit depth is (equal to screen) 24bpp.
> In x11drv/bitmap.c X11_GetBitmapBits takes in account just only bit
> depth of physical pixmap, and copies it to provided buffer as-is.
> I.e. it tries to fill buffer with size (e.g.) 48x48x4bpp with
> 48x48x24bpp that causes buffer overrun and late falling in
> SetBitmapBits function.

> --
> Cyril Margorin
>


--
Cyril Margorin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: user_cursoricon_copyimage.patch
Type: application/octet-stream
Size: 2001 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20051210/60efb88e/user_cursoricon_copyimage.obj


More information about the wine-patches mailing list