Fix possible use-after-free for number slider buttons

Mistake in e6f0b60c2e.
This commit is contained in:
2020-09-10 15:28:55 +02:00
parent eecd3705d7
commit 3cafaf0fa8

View File

@@ -632,7 +632,7 @@ static void ui_item_array(uiLayout *layout,
uiButNumber *number_but = (uiButNumber *)but;
but->a1 = number_but->step_size;
ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
but = ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
}
}
}
@@ -703,7 +703,7 @@ static void ui_item_array(uiLayout *layout,
uiButNumber *number_but = (uiButNumber *)but;
but->a1 = number_but->step_size;
ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
but = ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
}
if ((toggle == 1) && but->type == UI_BTYPE_CHECKBOX) {
but->type = UI_BTYPE_TOGGLE;
@@ -2299,7 +2299,7 @@ void uiItemFullR(uiLayout *layout,
uiButNumber *num_but = (uiButNumber *)but;
but->a1 = num_but->step_size;
ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
but = ui_but_change_type(but, UI_BTYPE_NUM_SLIDER);
}
if (flag & UI_ITEM_R_CHECKBOX_INVERT) {