Author: tkreuzer
Date: Wed Apr 25 17:29:50 2012
New Revision: 56422
URL:
http://svn.reactos.org/svn/reactos?rev=56422&view=rev
Log:
[WIN32K]
- Make XFORMOBJ_iSetXform fail, when the XFORM is invalid (eM11 or eM22 are 0)
- Handle error in GreModifyWorldTransform
Modified:
trunk/reactos/win32ss/gdi/ntgdi/coord.c
trunk/reactos/win32ss/gdi/ntgdi/xformobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/coord.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/coord.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/coord.c [iso-8859-1] Wed Apr 25 17:29:50 2012
@@ -461,20 +461,23 @@
case MWT_LEFTMULTIPLY:
XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage);
XFORMOBJ_vInit(&xoSrc, &mxSrc);
- XFORMOBJ_iSetXform(&xoSrc, pxform);
+ if (XFORMOBJ_iSetXform(&xoSrc, pxform) == DDI_ERROR)
+ return FALSE;
XFORMOBJ_iCombine(&xoDC, &xoSrc, &xoDC);
break;
case MWT_RIGHTMULTIPLY:
XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage);
XFORMOBJ_vInit(&xoSrc, &mxSrc);
- XFORMOBJ_iSetXform(&xoSrc, pxform);
+ if (XFORMOBJ_iSetXform(&xoSrc, pxform) == DDI_ERROR)
+ return FALSE;
XFORMOBJ_iCombine(&xoDC, &xoDC, &xoSrc);
break;
case MWT_MAX+1: // Must be MWT_SET????
XFORMOBJ_vInit(&xoDC, &pdc->pdcattr->mxWorldToPage);
- XFORMOBJ_iSetXform(&xoDC, pxform);
+ if (XFORMOBJ_iSetXform(&xoDC, pxform) == DDI_ERROR)
+ return FALSE;
break;
default:
Modified: trunk/reactos/win32ss/gdi/ntgdi/xformobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/xformobj…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/xformobj.c [iso-8859-1] Wed Apr 25 17:29:50 2012
@@ -160,10 +160,10 @@
PMATRIX pmx = XFORMOBJ_pmx(pxo);
/* Check parameters */
- if (!pxo || !pxform)
- {
- return DDI_ERROR;
- }
+ if (!pxo || !pxform) return DDI_ERROR;
+
+ /* Check if the xform is valid */
+ if ((pxform->eM11 == 0) || (pxform->eM22 == 0)) return DDI_ERROR;
/* Copy members */
FLOATOBJ_SetFloat(&pmx->efM11, pxform->eM11);