Hey, I've come across what appears to be a simple problem in comctl32. When running icq99b, wine was dying in imagelist.c while trying to dereference a null pointer. Upon looking at the file, there was code for returning FALSE if that pointer was null, thus I felt it being null may be a valid choice. I made the attached change, and the problem was fixed. Comments?
Index: imagelist.c =================================================================== RCS file: /home/wine/wine/dlls/comctl32/imagelist.c,v retrieving revision 1.65 diff -u -r1.65 imagelist.c --- imagelist.c 23 Oct 2002 22:19:11 -0000 1.65 +++ imagelist.c 2 Nov 2002 20:40:53 -0000 @@ -1082,11 +1082,14 @@ HBITMAP hImageBmp, hOldImageBmp, hOldImageListBmp, hOldMaskListBmp, hBlendMaskBmp; BOOL bIsTransparent, bBlend, bResult = FALSE; const HIMAGELIST himl = pimldp->himl; - const INT lx = himl->cx * pimldp->i + pimldp->xBitmap; - const INT ly = pimldp->yBitmap; + static INT lx; + static INT ly;
if (!pimldp || !himl) return FALSE; if ((pimldp->i < 0) || (pimldp->i >= himl->cCurImage)) return FALSE; + + lx = himl->cx * pimldp->i + pimldp->xBitmap; + ly = pimldp->yBitmap;
fState = pimldp->cbSize < sizeof(IMAGELISTDRAWPARAMS) ? ILS_NORMAL : pimldp->fState; fStyle = pimldp->fStyle & ~ILD_OVERLAYMASK;
On November 2, 2002 03:56 pm, DanteAliegri wrote:
I made the attached change, and the problem was fixed. Comments?
Yeap, good catch. Thanks!
On Sat, Nov 02, 2002 at 03:56:11PM -0500, DanteAliegri wrote:
Hey, I've come across what appears to be a simple problem in comctl32. When running icq99b, wine was dying in imagelist.c while trying to dereference a null pointer. Upon looking at the file, there was code for returning FALSE if that pointer was null, thus I felt it being null may be a valid choice. I made the attached change, and the problem was fixed. Comments?
Index: imagelist.c
RCS file: /home/wine/wine/dlls/comctl32/imagelist.c,v retrieving revision 1.65 diff -u -r1.65 imagelist.c --- imagelist.c 23 Oct 2002 22:19:11 -0000 1.65 +++ imagelist.c 2 Nov 2002 20:40:53 -0000 @@ -1082,11 +1082,14 @@ HBITMAP hImageBmp, hOldImageBmp, hOldImageListBmp, hOldMaskListBmp, hBlendMaskBmp; BOOL bIsTransparent, bBlend, bResult = FALSE; const HIMAGELIST himl = pimldp->himl;
- const INT lx = himl->cx * pimldp->i + pimldp->xBitmap;
- const INT ly = pimldp->yBitmap;
- static INT lx;
- static INT ly;
Do not use 'static' here, just INT.
Ciao, Marcus