diff --git a/reactos/subsys/win32k/dib/dib16bpp.c b/reactos/subsys/win32k/dib/dib16bpp.c index ed4c26c1811..1c8ef15f066 100644 --- a/reactos/subsys/win32k/dib/dib16bpp.c +++ b/reactos/subsys/win32k/dib/dib16bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib16bpp.c,v 1.17 2003/12/23 19:28:23 navaraf Exp $ */ +/* $Id: dib16bpp.c,v 1.18 2004/02/14 22:24:54 navaraf Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -422,7 +422,7 @@ void ScaleRectAvg16(PIXEL *Target, PIXEL *Source, int SrcWidth, int SrcHeight, int TgtWidth, int TgtHeight, int srcPitch, int dstPitch) { int NumPixels = TgtHeight; - int IntPart = (SrcHeight / TgtHeight) * (SrcWidth+1); + int IntPart = (SrcHeight / TgtHeight) * SrcWidth; int FractPart = SrcHeight % TgtHeight; int Mid = TgtHeight / 2; int E = 0; diff --git a/reactos/subsys/win32k/dib/dib8bpp.c b/reactos/subsys/win32k/dib/dib8bpp.c index ce5fc6918d6..9c679a2764c 100644 --- a/reactos/subsys/win32k/dib/dib8bpp.c +++ b/reactos/subsys/win32k/dib/dib8bpp.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: dib8bpp.c,v 1.12 2003/12/23 19:28:23 navaraf Exp $ */ +/* $Id: dib8bpp.c,v 1.13 2004/02/14 22:24:54 navaraf Exp $ */ #undef WIN32_LEAN_AND_MEAN #include #include @@ -393,7 +393,7 @@ void ScaleRectAvg8(PIXEL *Target, PIXEL *Source, int SrcWidth, int SrcHeight, int TgtWidth, int TgtHeight, int srcPitch, int dstPitch) { int NumPixels = TgtHeight; - int IntPart = (SrcHeight / TgtHeight) * (SrcWidth+1); + int IntPart = (SrcHeight / TgtHeight) * SrcWidth; int FractPart = SrcHeight % TgtHeight; int Mid = TgtHeight / 2; int E = 0; diff --git a/reactos/subsys/win32k/eng/surface.c b/reactos/subsys/win32k/eng/surface.c index 9b6f0c55d55..45b98f52bf3 100644 --- a/reactos/subsys/win32k/eng/surface.c +++ b/reactos/subsys/win32k/eng/surface.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: surface.c,v 1.31 2004/02/08 21:37:52 weiden Exp $ +/* $Id: surface.c,v 1.32 2004/02/14 22:24:54 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -351,15 +351,22 @@ EngCreateBitmap(IN SIZEL Size, SurfObj->pvBits = UncompressedBits; } else { - if(Flags & BMF_USERMEM) + if (SurfObj->cjBits == 0) { - SurfObj->pvBits = EngAllocUserMem(SurfObj->cjBits, 0); - } else { - if(Flags & BMF_NOZEROINIT) + SurfObj->pvBits = NULL; + } + else + { + if(Flags & BMF_USERMEM) { - SurfObj->pvBits = EngAllocMem(0, SurfObj->cjBits, 0); + SurfObj->pvBits = EngAllocUserMem(SurfObj->cjBits, 0); } else { - SurfObj->pvBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0); + if(Flags & BMF_NOZEROINIT) + { + SurfObj->pvBits = EngAllocMem(0, SurfObj->cjBits, 0); + } else { + SurfObj->pvBits = EngAllocMem(FL_ZERO_MEMORY, SurfObj->cjBits, 0); + } } } }