Commit 1740fe0f authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

comctl32: Add OOM codepath in imagelist control.

parent 8122173a
...@@ -1833,6 +1833,7 @@ static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) { ...@@ -1833,6 +1833,7 @@ static HBITMAP _read_bitmap(LPSTREAM pstm,int ilcFlag,int cx,int cy) {
width = bmih.biWidth; width = bmih.biWidth;
height = bmih.biHeight; height = bmih.biHeight;
bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace); bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace);
if (!bmihc) goto ret1;
memcpy(bmihc,&bmih,sizeof(bmih)); memcpy(bmihc,&bmih,sizeof(bmih));
longsperline = ((width*bitsperpixel+31)&~0x1f)>>5; longsperline = ((width*bitsperpixel+31)&~0x1f)>>5;
bmihc->biSizeImage = (longsperline*height)<<2; bmihc->biSizeImage = (longsperline*height)<<2;
...@@ -1962,8 +1963,10 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) ...@@ -1962,8 +1963,10 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
#endif #endif
hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy); hbmColor = _read_bitmap(pstm,ilHead.flags & ~ILC_MASK,ilHead.cx,ilHead.cy);
if (!hbmColor) if (!hbmColor) {
WARN("failed to read bitmap from stream\n");
return NULL; return NULL;
}
if (ilHead.flags & ILC_MASK) { if (ilHead.flags & ILC_MASK) {
hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy); hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy);
if (!hbmMask) { if (!hbmMask) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment