From 2d1f3a6cc1b382da4376ff87268ba9b84f07ba1c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 5 May 2016 01:56:23 +0300 Subject: Add missing check into function recalcSpritesOrder. --- src/being/being.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index b1ca910e0..76b9de904 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -96,6 +96,7 @@ #include "gui/widgets/tabs/chat/langtab.h" +#include "utils/checkutils.h" #include "utils/delete2.h" #include "utils/files.h" #include "utils/gettext.h" @@ -3307,7 +3308,9 @@ void Being::recalcSpritesOrder() restrict2 updatedSprite[slot] = false; } - const size_t spriteIdSize = mSpriteIDs.size(); + size_t spriteIdSize = mSpriteIDs.size(); + if (reportTrue(spriteIdSize > 20)) + spriteIdSize = 20; for (size_t slot = 0; slot < sz; slot ++) { @@ -3555,7 +3558,7 @@ void Being::recalcSpritesOrder() restrict2 } } } - for (unsigned slot = 0; slot < spriteIdSize; slot ++) + for (size_t slot = 0; slot < spriteIdSize; slot ++) { if (mSpriteHide[slot] == 0) { -- cgit v1.2.3-70-g09d2