[aseprite] 144/196: Fix crash using RotSprite algorithm on Sprite Size command

Tobias Hansen thansen at moszumanska.debian.org
Wed Apr 20 18:50:13 UTC 2016


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

thansen pushed a commit to branch master
in repository aseprite.

commit 833878473514174ce64b41ebd820f6768e106175
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Apr 4 11:39:32 2016 -0300

    Fix crash using RotSprite algorithm on Sprite Size command
---
 src/doc/algorithm/rotate.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/doc/algorithm/rotate.cpp b/src/doc/algorithm/rotate.cpp
index e05dc0b..23b0953 100644
--- a/src/doc/algorithm/rotate.cpp
+++ b/src/doc/algorithm/rotate.cpp
@@ -68,8 +68,14 @@ static void image_scale_tpl(
       x = fixadd(x, dx);
       new_x = fixtoi(x);
       if (old_x != new_x) {
-        src_it += (new_x - old_x);
-        old_x = new_x;
+        // We don't want to move the "src_it" iterator outside the src
+        // image bounds.
+        if (new_x < src_w) {
+          src_it += (new_x - old_x);
+          old_x = new_x;
+        }
+        else
+          break;
       }
     }
 

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



More information about the Pkg-games-commits mailing list