Module: wine Branch: refs/heads/master Commit: 1740fe0fe65fb04d07396f544b4b6f13626d67ee URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=1740fe0fe65fb04d07396f54...
Author: Mike Hearn mike@plan99.net Date: Thu Apr 6 21:42:39 2006 +0100
comctl32: Add OOM codepath in imagelist control.
---
dlls/comctl32/imagelist.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 551f91a..45a02be 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -1833,6 +1833,7 @@ static HBITMAP _read_bitmap(LPSTREAM pst width = bmih.biWidth; height = bmih.biHeight; bmihc = (LPBITMAPINFOHEADER)LocalAlloc(LMEM_ZEROINIT,sizeof(bmih)+palspace); + if (!bmihc) goto ret1; memcpy(bmihc,&bmih,sizeof(bmih)); longsperline = ((width*bitsperpixel+31)&~0x1f)>>5; bmihc->biSizeImage = (longsperline*height)<<2; @@ -1962,8 +1963,10 @@ HIMAGELIST WINAPI ImageList_Read (LPSTRE #endif
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; + } if (ilHead.flags & ILC_MASK) { hbmMask = _read_bitmap(pstm,0,ilHead.cx,ilHead.cy); if (!hbmMask) {