diff options
author | Robin Gareus <robin@gareus.org> | 2014-11-17 03:58:05 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-11-17 03:58:05 +0100 |
commit | 55ce10f498f4fddfe5d31c7fef47eb805a9a45a5 (patch) | |
tree | 3c57cb868f2268be925a69cc3e0c65d3a2d7c668 /gtk2_ardour | |
parent | ad739cd018df8d746de77cbe7feb8e52fb315114 (diff) |
NULL pointer dereference?
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index c47e997182..da5dcb2df5 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4288,7 +4288,9 @@ Editor::undo_visual_state () redo_visual_stack.push_back (current_visual_state (vs ? vs->gui_state != 0 : false)); - use_visual_state (*vs); + if (vs) { + use_visual_state (*vs); + } } void @@ -4301,9 +4303,13 @@ Editor::redo_visual_state () VisualState* vs = redo_visual_stack.back(); redo_visual_stack.pop_back(); - undo_visual_stack.push_back (current_visual_state (vs ? vs->gui_state != 0 : false)); + // can 'vs' really be 0? Is there a place that puts NULL pointers onto the stack? + // why do we check here? + undo_visual_stack.push_back (current_visual_state (vs ? (vs->gui_state != 0) : false)); - use_visual_state (*vs); + if (vs) { + use_visual_state (*vs); + } } void |