[colobot] 12/100: Fix buffer overrun when rendering goto() debug texture, closes #841

Didier Raboud odyx at moszumanska.debian.org
Thu Jun 1 18:10:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit 3bac0aabd98d52eb2e5d33c8e192961f5f7368a1
Author: krzys-h <krzys_h at interia.pl>
Date:   Fri Nov 11 17:26:37 2016 +0100

    Fix buffer overrun when rendering goto() debug texture, closes #841
---
 src/graphics/engine/engine.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index b2aa631..3110cd3 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -4404,6 +4404,9 @@ void CEngine::UpdateGroundSpotTextures()
                     {
                         int px = x / 4.0f / 254.0f * size.x;
                         int py = y / 4.0f / 254.0f * size.y;
+                        // This can happen because the shadow??.png textures have a 1 pixel margin around them
+                        if (px < 0 || px >= size.x || py < 0 || py >= size.y)
+                            continue;
                         shadowImg.SetPixelInt(Math::IntPoint(x-min.x, y-min.y), m_displayGotoImage->GetPixelInt(Math::IntPoint(px, py)));
                     }
                 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list