summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-25 11:33:59 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2006-12-25 11:33:59 +0000
commit8234e4e0e3ad32be707236aa248df28399a25ccf (patch)
treef62e8d24c4a8aa53671c44a2e3d34d8074d78273
parentaaa339fd96f4266d7774ef5c8a196047411a6926 (diff)
downloadmana-client-8234e4e0e3ad32be707236aa248df28399a25ccf.tar.gz
mana-client-8234e4e0e3ad32be707236aa248df28399a25ccf.tar.bz2
mana-client-8234e4e0e3ad32be707236aa248df28399a25ccf.tar.xz
mana-client-8234e4e0e3ad32be707236aa248df28399a25ccf.zip
Fixed index check to prevent crashing.
-rw-r--r--ChangeLog1
-rw-r--r--src/resources/spriteset.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bda5a8d8..9cc2de42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* data/graphics/tiles/christmastree.png, data/maps/new_11-1.tmx.gz:
Added Christmas tree by Pauan.
* data/graphics/sprites/head-christmastree.xml: Fixed name of image.
+ * src/resources/spriteset.cpp: Fixed index check to prevent crashing.
2006-12-24 Bjørn Lindeijer <bjorn@lindeijer.nl>
diff --git a/src/resources/spriteset.cpp b/src/resources/spriteset.cpp
index 9b09f1e5..96bcef0c 100644
--- a/src/resources/spriteset.cpp
+++ b/src/resources/spriteset.cpp
@@ -53,7 +53,7 @@ Spriteset::~Spriteset()
Image*
Spriteset::get(size_type i)
{
- if (i > mSpriteset.size())
+ if (i >= mSpriteset.size())
{
logger->log("Warning: Sprite #%i does not exist in this spriteset", i);
return NULL;