From fc28eefaed2c71a824677b613f87dc4ceaea243b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 2 Feb 2017 19:22:45 +0300 Subject: Fix nullpointer access in special layer draw function. --- src/resources/map/maplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/resources/map/maplayer.cpp') diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp index 95e835302..deaeab9de 100644 --- a/src/resources/map/maplayer.cpp +++ b/src/resources/map/maplayer.cpp @@ -391,7 +391,7 @@ void MapLayer::drawSpecialLayer(Graphics *const graphics, const MapItem *item0 = mSpecialLayer->mTiles[ptr + startX]; if (!item0 || item0->mType == MapItemType::EMPTY) { - x0 += mSpecialLayer->mCache[ptr + startX]; + x0 += mSpecialLayer->mCache[ptr + startX] + 1; } for (int x = x0; x < endX1; x++) { @@ -414,7 +414,7 @@ void MapLayer::drawSpecialLayer(Graphics *const graphics, item0 = mTempLayer->mTiles[ptr + startX]; if (!item0 || item0->mType == MapItemType::EMPTY) { - x0 += mTempLayer->mCache[ptr + startX]; + x0 += mTempLayer->mCache[ptr + startX] + 1; } for (int x = x0; x < endX1; x++) { -- cgit v1.2.3-60-g2f50