summaryrefslogtreecommitdiff
path: root/src/blitter
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-08-10 13:11:53 +0000
committertruelight <truelight@openttd.org>2007-08-10 13:11:53 +0000
commit6771f5ca2095fd564189fb650b2003c9be9166f5 (patch)
tree858b6ef26e7ebc5e10769a3cf6f088878e6c2728 /src/blitter
parent61b21547e8e77ab9f3b84b3e2b3071d54a19eb72 (diff)
downloadopenttd-6771f5ca2095fd564189fb650b2003c9be9166f5.tar.xz
(svn r10837) -Fix [FS#1102]: DrawLine didn't bound-check the first pixel that was drawn (frosch)
Diffstat (limited to 'src/blitter')
-rw-r--r--src/blitter/32bpp_base.cpp2
-rw-r--r--src/blitter/8bpp_base.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/blitter/32bpp_base.cpp b/src/blitter/32bpp_base.cpp
index 496dc6253..378873ec0 100644
--- a/src/blitter/32bpp_base.cpp
+++ b/src/blitter/32bpp_base.cpp
@@ -56,7 +56,7 @@ void Blitter_32bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int
stepx = 1;
}
- this->SetPixel(video, x, y, color);
+ if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
if (dx > dy) {
frac = dy - (dx / 2);
while (x != x2) {
diff --git a/src/blitter/8bpp_base.cpp b/src/blitter/8bpp_base.cpp
index 4a2753af6..a931df624 100644
--- a/src/blitter/8bpp_base.cpp
+++ b/src/blitter/8bpp_base.cpp
@@ -60,7 +60,7 @@ void Blitter_8bppBase::DrawLine(void *video, int x, int y, int x2, int y2, int s
stepx = 1;
}
- this->SetPixel(video, x, y, color);
+ if (x > 0 && y > 0 && x < screen_width && y < screen_height) this->SetPixel(video, x, y, color);
if (dx > dy) {
frac = dy - (dx / 2);
while (x != x2) {