From bb84359c4143c6c942f25a4a16ce64a43dbab9c4 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 4 Nov 2000 02:55:08 +0000 Subject: [PATCH] Avoid division by zero. --- dlls/ddraw/dsurface/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/ddraw/dsurface/main.c b/dlls/ddraw/dsurface/main.c index 4d123b9ac51..fb66438175f 100644 --- a/dlls/ddraw/dsurface/main.c +++ b/dlls/ddraw/dsurface/main.c @@ -281,6 +281,8 @@ HRESULT WINAPI IDirectDrawSurface4Impl_Blt( LPBYTE sbase; int sx, xinc, sy, yinc; + if (!dstwidth || !dstheight) /* hmm... stupid program ? */ + goto release; sbase = (BYTE*)sdesc.u1.lpSurface+(xsrc.top*sdesc.lPitch)+xsrc.left*bpp; xinc = (srcwidth << 16) / dstwidth; yinc = (srcheight << 16) / dstheight;