Is this a bug in Office 2007 or are we doing something wrong here?
Am 17.02.2015 um 21:41 schrieb jgardou(a)svn.reactos.org:
Author: jgardou
Date: Tue Feb 17 20:41:51 2015
New Revision: 66342
URL:
http://svn.reactos.org/svn/reactos?rev=66342&view=rev
Log:
[WIN32SS/NTGDI]
- Reject bits data early in SetBitmapBits when it's clear that they
can't fit in the destination bitmap.
Fixes ugly Office 2007 rulers showing garbage.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitmaps.…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/bitmaps.c [iso-8859-1] Tue Feb
17 20:41:51 2015
@@ -11,7 +11,8 @@
#define NDEBUG
#include <debug.h>
-void
+static
+int
NTAPI
UnsafeSetBitmapBits(
PSURFACE psurf,
@@ -32,6 +33,9 @@
lDeltaDst = psurf->SurfObj.lDelta;
lDeltaSrc = WIDTH_BYTES_ALIGN16(nWidth, cBitsPixel);
+ if (cjBits && (cjBits < (lDeltaSrc * nHeight)))
+ return 0;
+
while (nHeight--)
{
/* Copy one line */
@@ -40,6 +44,7 @@
pjDst += lDeltaDst;
}
+ return 1;
}
HBITMAP
@@ -538,9 +543,8 @@
_SEH2_TRY
{
- ProbeForRead(pUnsafeBits, Bytes, 1);
- UnsafeSetBitmapBits(psurf, Bytes, pUnsafeBits);
- ret = 1;
+ ProbeForRead(pUnsafeBits, Bytes, sizeof(WORD));
+ ret = UnsafeSetBitmapBits(psurf, Bytes, pUnsafeBits);
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org