aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/tile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/tile.c b/source/tile.c
index 38ac831..2211421 100644
--- a/source/tile.c
+++ b/source/tile.c
@@ -467,6 +467,9 @@ static void WRITE_4PIXELS16_ADD(int32 Offset, uint8* Pixels,
uint16* ScreenColors)
{
uint8 Pixel, N;
+ if (Offset < 0)
+ Offset = 0;
+
uint16* Screen = (uint16*) GFX.S + Offset;
uint8* Depth = GFX.ZBuffer + Offset;
uint8* SubDepth = GFX.SubZBuffer + Offset;
@@ -496,6 +499,9 @@ static void WRITE_4PIXELS16_FLIPPED_ADD(int32 Offset, uint8* Pixels,
uint16* ScreenColors)
{
uint8 Pixel, N;
+ if (Offset < 0)
+ Offset = 0;
+
uint16* Screen = (uint16*) GFX.S + Offset;
uint8* Depth = GFX.ZBuffer + Offset;
uint8* SubDepth = GFX.SubZBuffer + Offset;