Only set the pattern function pointer if the pattern surface is valid, spotted by...
[reactos.git] / reactos / subsystems / win32 / win32k / eng / bitblt.c
index be39c20..3c65aaa 100644 (file)
@@ -67,8 +67,8 @@ BltMask(SURFOBJ* psoDest,
             psoPattern = &psurfPattern->SurfObj;
             PatternWidth = psoPattern->sizlBitmap.cx;
             PatternHeight = psoPattern->sizlBitmap.cy;
+            fnPattern_GetPixel = DibFunctionsForBitmapFormat[psoPattern->iBitmapFormat].DIB_GetPixel;
         }
-        fnPattern_GetPixel = DibFunctionsForBitmapFormat[psoPattern->iBitmapFormat].DIB_GetPixel;
     }
     else
         psurfPattern = NULL;