summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fontwrapper-ft.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-06-25 12:41:18 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-07-01 01:12:00 +0200
commitb06106206de2922369122e7b0f4c3908ac960175 (patch)
tree5c123ac67fdad3416b3187d642b60d91c0ccedda /crawl-ref/source/fontwrapper-ft.cc
parent47acb2b5b0c245689d5e5d8da4275a5ed3ade0a5 (diff)
downloadcrawl-ref-b06106206de2922369122e7b0f4c3908ac960175.tar.gz
crawl-ref-b06106206de2922369122e7b0f4c3908ac960175.zip
Fix a potential integer overflow.
GCC seems to handle values above 255, but let's better play it safe.
Diffstat (limited to 'crawl-ref/source/fontwrapper-ft.cc')
-rw-r--r--crawl-ref/source/fontwrapper-ft.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/fontwrapper-ft.cc b/crawl-ref/source/fontwrapper-ft.cc
index eba88f3d88..1659b71d47 100644
--- a/crawl-ref/source/fontwrapper-ft.cc
+++ b/crawl-ref/source/fontwrapper-ft.cc
@@ -292,7 +292,7 @@ ucs_t FTFontWrapper::map_unicode(ucs_t uchar, bool update)
pixels[idx] = orig;
pixels[idx + 1] = orig;
pixels[idx + 2] = orig;
- pixels[idx + 3] = std::min(orig + edge, 255);
+ pixels[idx + 3] = std::min((int)orig + edge, 255);
}
}
}