fixed crash bug with masked blitting in headless mode
[rocksndiamonds.git] / src / libgame / system.c
index f824ac511c0dd5d81318e8b643846d318de77650..e83df10bb1250a83e405380cd3189c77d8006bd4 100644 (file)
@@ -938,6 +938,12 @@ void BlitBitmapMasked(Bitmap *src_bitmap, Bitmap *dst_bitmap,
                      int src_x, int src_y, int width, int height,
                      int dst_x, int dst_y)
 {
+  if (program.headless)
+    return;
+
+  if (src_bitmap == NULL || dst_bitmap == NULL)
+    return;
+
   if (DrawingDeactivated(dst_x, dst_y))
     return;