[Bf-blender-cvs] [ee01b660eb5] master: Fix use of uninitialized stack memory

Campbell Barton noreply at git.blender.org
Tue Mar 12 05:52:46 CET 2019


Commit: ee01b660eb5b17aefdb9773fc1269934136f1d15
Author: Campbell Barton
Date:   Tue Mar 12 15:17:26 2019 +1100
Branches: master
https://developer.blender.org/rBee01b660eb5b17aefdb9773fc1269934136f1d15

Fix use of uninitialized stack memory

The matrix multiply uses x,y values so both must be initialized.

===================================================================

M	source/blender/editors/interface/interface.c

===================================================================

diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index ffb13e9facf..e8c63fb0224 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -163,7 +163,9 @@ float ui_block_to_window_scale(const ARegion *ar, uiBlock *block)
 	/* We could have function for this to avoid dummy arg. */
 	float dummy_x;
 	float min_y = 0, max_y = 1;
+	dummy_x = 0.0f;
 	ui_block_to_window_fl(ar, block, &dummy_x, &min_y);
+	dummy_x = 0.0f;
 	ui_block_to_window_fl(ar, block, &dummy_x, &max_y);
 	return max_y - min_y;
 }



More information about the Bf-blender-cvs mailing list