From bf7f9244a95962c9833e68743726fe83a00b732c Mon Sep 17 00:00:00 2001 From: Hubert Jarosz Date: Mon, 29 Feb 2016 23:36:19 +0100 Subject: fix two reading uninitialized pointers fixed in: tools/editor/project_settings.cpp scene/gui/graph_edit.cpp --- scene/gui/graph_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/gui') diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index c9c9dbd1d2..9123194589 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -617,7 +617,7 @@ void GraphEdit::_input_event(const InputEvent& p_ev) { if (b.button_index==BUTTON_LEFT && b.pressed) { - GraphNode *gn; + GraphNode *gn = NULL; for(int i=get_child_count()-1;i>=0;i--) { gn=get_child(i)->cast_to(); -- cgit v1.2.3 From 7b07bcaf449ea6cf52c2ac501e48cddbe4bde035 Mon Sep 17 00:00:00 2001 From: Hubert Jarosz Date: Tue, 1 Mar 2016 00:08:33 +0100 Subject: fix six possible "divide by zero" --- scene/gui/color_picker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scene/gui') diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index f8f8b1f6d1..bd24b43761 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -361,7 +361,10 @@ void ColorPicker::_preset_input(const InputEvent &ev) { emit_signal("color_changed", color); } else if (ev.type == InputEvent::MOUSE_MOTION) { const InputEventMouse &mev = ev.mouse_motion; - int index = mev.x/(preset->get_size().x/presets.size()); + int index = mev.x * presets.size(); + if( preset->get_size().x != 0 ) { + index /= preset->get_size().x; + } if (index<0 || index >= presets.size()) return; preset->set_tooltip("Color: #"+presets[index].to_html(presets[index].a<1)+"\n" @@ -684,4 +687,3 @@ ColorPickerButton::ColorPickerButton() { picker->connect("color_changed",this,"_color_changed"); add_child(popup); } - -- cgit v1.2.3