fixed crash bug for some graphics configurations with global border
[rocksndiamonds.git] / src / tools.c
index 144bce2afeb7dc36852b81bc32cb66192fe3b405..c8070fa2365f3349e0e68b3a9785f3c9c218f564 100644 (file)
@@ -512,6 +512,10 @@ static void DrawMaskedBorderExt_Rect(int x, int y, int width, int height,
   Bitmap *src_bitmap = getGlobalBorderBitmapFromStatus(global.border_status);
   Bitmap *dst_bitmap = gfx.masked_border_bitmap_ptr;
 
+  // may happen for "border.draw_masked.*" with undefined "global.border.*"
+  if (src_bitmap == NULL)
+    return;
+
   if (x == -1 && y == -1)
     return;