fixed crash bug with masked blitting in headless mode
authorHolger Schemel <info@artsoft.org>
Fri, 23 Feb 2024 00:01:39 +0000 (01:01 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Feb 2024 00:01:39 +0000 (01:01 +0100)
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;