[aseprite] 41/250: Add some checks to Menu::closeAll() to avoid accessing null pointers

Tobias Hansen thansen at moszumanska.debian.org
Sun Dec 20 15:27:09 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 182a094f2bb7881575a5798aed991debebf6265a
Author: David Capello <davidcapello at gmail.com>
Date:   Wed Sep 16 10:52:02 2015 -0300

    Add some checks to Menu::closeAll() to avoid accessing null pointers
    
    These are not reproducible situations, but we've received a crash
    report that indicates that these pointers can be null if some
    unknown scenario.
---
 src/ui/menu.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/ui/menu.cpp b/src/ui/menu.cpp
index 9f98d68..1b4c06d 100644
--- a/src/ui/menu.cpp
+++ b/src/ui/menu.cpp
@@ -1125,7 +1125,15 @@ void Menu::closeAll()
   }
 
   MenuBox* base_menubox = get_base_menubox(menu->getParent());
+  ASSERT(base_menubox);
+  if (!base_menubox)
+    return;
+
   MenuBaseData* base = base_menubox->getBase();
+  ASSERT(base);
+  if (!base)
+    return;
+
   base->close_all = true;
   base->was_clicked = false;
   if (base->is_filtering) {

-- 
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