[aseprite] 117/134: Fix crash trying to move pixels and the current layer is nullptr
Tobias Hansen
thansen at moszumanska.debian.org
Sat Mar 14 17:10:16 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 2a582638ec89e021ce146dcd30f9a978edb5c110
Author: David Capello <davidcapello at gmail.com>
Date: Wed Jan 28 11:04:07 2015 -0300
Fix crash trying to move pixels and the current layer is nullptr
This fix was found thanks to a user provided memory dump. We don't know
why the layer can be nullptr, but there are some conditions preventing
this situation already in other places of the StandbyState::onMouseDown()
member function.
---
src/app/ui/editor/standby_state.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp
index d8fd49c..205de71 100644
--- a/src/app/ui/editor/standby_state.cpp
+++ b/src/app/ui/editor/standby_state.cpp
@@ -243,7 +243,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
if (handle != NoHandle) {
int x, y, opacity;
Image* image = location.image(&x, &y, &opacity);
- if (image) {
+ if (layer && image) {
if (!layer->isWritable()) {
StatusBar::instance()->showTip(1000,
"Layer '%s' is locked", layer->name().c_str());
@@ -258,7 +258,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
}
// Move selected pixels
- if (editor->isInsideSelection() && msg->left()) {
+ if (layer && editor->isInsideSelection() && msg->left()) {
if (!layer->isWritable()) {
StatusBar::instance()->showTip(1000,
"Layer '%s' is locked", layer->name().c_str());
--
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