summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2014-01-13 15:26:13 +0100
committerFrank Gevaerts <frank@gevaerts.be>2014-01-13 15:26:13 +0100
commit72367f458e43a4bf231032331ed6423e2930151f (patch)
treea0965abec6d03e0acfbf0171ece1dcf4a14df951
parentf0bec023d9ff45cede09274dff12f015f0830a38 (diff)
downloadrockbox-72367f458e43a4bf231032331ed6423e2930151f.tar.gz
rockbox-72367f458e43a4bf231032331ed6423e2930151f.zip
Don't try to set default_val in volume_limit_is_changed().
We don't use the default_val anywhere, so there's no need to try to use it in a buggy and null pointer dereferencing way here. Change-Id: Ie60dbab7647056e2bf457cb5dcc5b60012ea1651
-rw-r--r--apps/settings_list.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 01bc5c53f4..838d783cbd 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -675,10 +675,8 @@ static char* volume_limit_write_to_cfg(void* setting, char*buf, int buf_len)
675} 675}
676static bool volume_limit_is_changed(void* setting, void* defaultval) 676static bool volume_limit_is_changed(void* setting, void* defaultval)
677{ 677{
678 (void)defaultval;
678 int current = *(int*)setting; 679 int current = *(int*)setting;
679
680 if ((int*)defaultval == NULL)
681 *(int*)defaultval = sound_max(SOUND_VOLUME);
682 return (current != sound_max(SOUND_VOLUME)); 680 return (current != sound_max(SOUND_VOLUME));
683} 681}
684static void volume_limit_set_default(void* setting, void* defaultval) 682static void volume_limit_set_default(void* setting, void* defaultval)