[ros-dev] [ros-diffs] [jgardou] 66342: [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.
Timo Kreuzer
timo.kreuzer at web.de
Wed Feb 18 08:40:54 UTC 2015
Is this a bug in Office 2007 or are we doing something wrong here?
Am 17.02.2015 um 21:41 schrieb jgardou at 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.c?rev=66342&r1=66341&r2=66342&view=diff
> ==============================================================================
> --- 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)
> {
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3683 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20150218/74d7e611/attachment.bin>
More information about the Ros-dev
mailing list