[Phission-cvs] phission/display/gdi/src phGDIImageWindow.cpp, 1.15, 1.16
Brought to you by:
pthoren
From: Philip T. <pt...@us...> - 2007-08-13 23:25:03
|
Update of /cvsroot/phission/phission/display/gdi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9312 Modified Files: phGDIImageWindow.cpp Log Message: Fixed a null pointer access error that can occur Index: phGDIImageWindow.cpp =================================================================== RCS file: /cvsroot/phission/phission/display/gdi/src/phGDIImageWindow.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** phGDIImageWindow.cpp 20 Nov 2006 22:49:33 -0000 1.15 --- phGDIImageWindow.cpp 13 Aug 2007 22:51:47 -0000 1.16 *************** *** 320,323 **** --- 320,324 ---- return 0; } + if (lp == 0x0) return 0; /* Grab a pointer passed to CreateWindow as lpParam */ phGDI_pair_t *p = (phGDI_pair_t *)LPCBT_CREATEWND(lp)->lpcs->lpCreateParams; *************** *** 325,329 **** * rehooking windows when CreateWindow is called recursively */ /* ie, when you create windows from a WM_CREATE handler */ ! if (p->thisptr != NULL) { /* Stash the associated Window pointer, which is the first member --- 326,330 ---- * rehooking windows when CreateWindow is called recursively */ /* ie, when you create windows from a WM_CREATE handler */ ! if ((p != NULL) && (p->thisptr != NULL)) { /* Stash the associated Window pointer, which is the first member *************** *** 341,346 **** p->thisptr = NULL; } ! /* Call the next hook in chain, using the second member of the pair */ ! return ::CallNextHookEx(p->hook, code, wp, lp); } --- 342,350 ---- p->thisptr = NULL; } ! if (p != NULL) ! /* Call the next hook in chain, using the second member of the pair */ ! return ::CallNextHookEx(p->hook, code, wp, lp); ! else ! return 0; } |