Check for shader parameter step set to 0.0 and handle it outside the otherwise neverending loop; should fix #16958 (#16962)

This commit is contained in:
Antonio Orefice 2024-09-05 07:53:24 +02:00 committed by GitHub
parent 43e5492002
commit 139f461d06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11732,6 +11732,22 @@ static unsigned menu_displaylist_build_shader_parameter(
current_value = min;
original_value = param->current;
if (half_step <= 0.0) { /* safety check */
char val_s[16], val_d[16];
snprintf(val_s, sizeof(val_s), "%.2f", current_value);
snprintf(val_d, sizeof(val_d), "%d", 0);
menu_entries_append(list,
val_s,
val_d,
MENU_ENUM_LABEL_NO_ITEMS,
setting_type,
i, entry_type, NULL);
count = 1;
checked = 1.0;
checked_found = true;
}
else
{
for (i = 0; current_value < (max + 0.0001f); i++)
{
char val_s[16], val_d[16];
@ -11757,6 +11773,7 @@ static unsigned menu_displaylist_build_shader_parameter(
current_value += param->step;
}
}
if (checked_found)
{