Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-11-26 07:47:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-26 07:47:20 +0400
commite77e1f183ae6732eadda82ba1d7ab9975a9224f8 (patch)
tree080f565b65e74203b8f7bf6717bb6d9c27251195 /source/blender/editors/animation
parent3d64381e4de22c8c65177b8f8d1b541284ae4483 (diff)
fix for uninitialized memory use with numeric input:
bevel/inset/marker-move would use uninitialized memory when used as modal operators and pressing backspace after entering values.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_markers.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 4ac7b61fccb..d595034032e 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -860,16 +860,21 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
}
if (evt->val == KM_PRESS) {
- float vec;
- char str_tx[NUM_STR_REP_LEN];
-
if (handleNumInput(&mm->num, evt)) {
- applyNumInput(&mm->num, &vec);
- outputNumInput(&mm->num, str_tx);
-
- RNA_int_set(op->ptr, "frames", vec);
+ char str_tx[NUM_STR_REP_LEN];
+ float value = RNA_int_get(op->ptr, "frames");
+ applyNumInput(&mm->num, &value);
+
+ if (hasNumInput(&mm->num)) {
+ outputNumInput(&mm->num, str_tx);
+ }
+ else {
+ BLI_snprintf(str_tx, sizeof(str_tx), "%d", (int)value);
+ }
+
+ RNA_int_set(op->ptr, "frames", value);
ed_marker_move_apply(C, op);
- // ed_marker_header_update(C, op, str, (int)vec[0]);
+ // ed_marker_header_update(C, op, str, (int)value);
// strcat(str, str_tx);
BLI_snprintf(str, sizeof(str), "Marker offset %s", str_tx);
ED_area_headerprint(CTX_wm_area(C), str);