summaryrefslogtreecommitdiff
path: root/smallmap_gui.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-10 17:23:21 +0000
committertruelight <truelight@openttd.org>2004-08-10 17:23:21 +0000
commitf2623b5ee98875cd253793426e580f24d026f341 (patch)
tree9c1271e44bbb70287f9befb26b0b26985b7e8a67 /smallmap_gui.c
parenta9413b12a25ca3f2fca654084c3cbea621fd5255 (diff)
downloadopenttd-f2623b5ee98875cd253793426e580f24d026f341.tar.xz
(svn r13) Fix #972087 - minimap crash
Diffstat (limited to 'smallmap_gui.c')
-rw-r--r--smallmap_gui.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/smallmap_gui.c b/smallmap_gui.c
index 95bd826cf..f5aa0551d 100644
--- a/smallmap_gui.c
+++ b/smallmap_gui.c
@@ -351,7 +351,8 @@ static void DrawSmallMapContours(byte *dst, uint xc, uint yc, int pitch, int rep
{
do {
if (xc < TILE_X_MAX && yc < TILE_Y_MAX)
- WRITE_PIXELS_OR( dst, GetSmallMapCountoursPixels(TILE_XY(xc,yc)) & mask );
+ if (dst > _screen.dst_ptr && dst < (_screen.dst_ptr + _screen.width * _screen.height - _screen.width) )
+ WRITE_PIXELS_OR( dst, GetSmallMapCountoursPixels(TILE_XY(xc,yc)) & mask );
} while (xc++,yc++,dst+=pitch,--reps != 0);
}