From 755cc9c50f1df7cd67995ca7bba91302d436fbd3 Mon Sep 17 00:00:00 2001 From: fgenesis Date: Mon, 17 Sep 2012 03:32:18 +0200 Subject: [PATCH] Fix possible crash when moving the Y-axis of camera out of bounds when zoomed out. This was a regression from my earlier GridRender optimization patch. --- Aquaria/GridRender.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Aquaria/GridRender.cpp b/Aquaria/GridRender.cpp index f95ae1c..3ebcd41 100644 --- a/Aquaria/GridRender.cpp +++ b/Aquaria/GridRender.cpp @@ -108,6 +108,8 @@ void GridRender::onRender() startY = 0; if (endY >= MAX_GRID) endY = MAX_GRID-1; + if (startY > endY) + return; for (int x = startX; x <= endX; ++x) { const signed char *gridColumn = dsq->game->getGridColumn(x);