(menu_hash) Prevent dereferences when settings is NULL

This commit is contained in:
twinaphex 2016-06-20 03:10:26 +02:00
parent 75b9a1312d
commit 69c82da160
5 changed files with 30 additions and 15 deletions

View File

@ -42,6 +42,7 @@ int menu_hash_get_help_de(uint32_t hash, char *s, size_t len)
switch (hash)
{
case MENU_LABEL_INPUT_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->input.driver);
switch (driver_hash)
@ -147,6 +148,7 @@ int menu_hash_get_help_de(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_VIDEO_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->video.driver);
switch (driver_hash)
@ -224,6 +226,7 @@ int menu_hash_get_help_de(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_AUDIO_RESAMPLER_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->audio.resampler);
switch (driver_hash)

View File

@ -126,6 +126,7 @@ int menu_hash_get_help_es(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_INPUT_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->input.driver);
switch (driver_hash)
@ -239,6 +240,7 @@ int menu_hash_get_help_es(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_VIDEO_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->video.driver);
switch (driver_hash)
@ -323,6 +325,7 @@ int menu_hash_get_help_es(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_AUDIO_RESAMPLER_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->audio.resampler);
switch (driver_hash)

View File

@ -120,6 +120,7 @@ int menu_hash_get_help_it(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_INPUT_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->input.driver);
switch (driver_hash)
@ -212,6 +213,7 @@ int menu_hash_get_help_it(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_VIDEO_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->video.driver);
switch (driver_hash)
@ -290,6 +292,7 @@ int menu_hash_get_help_it(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_AUDIO_RESAMPLER_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->audio.resampler);
switch (driver_hash)

View File

@ -43,6 +43,7 @@ int menu_hash_get_help_pt(uint32_t hash, char *s, size_t len)
switch (hash)
{
case MENU_LABEL_INPUT_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->input.driver);
switch (driver_hash)
@ -136,6 +137,7 @@ int menu_hash_get_help_pt(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_VIDEO_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->video.driver);
switch (driver_hash)
@ -214,6 +216,7 @@ int menu_hash_get_help_pt(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_AUDIO_RESAMPLER_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->audio.resampler);
switch (driver_hash)

View File

@ -111,6 +111,7 @@ int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_INPUT_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->input.driver);
switch (driver_hash)
@ -203,6 +204,7 @@ int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_VIDEO_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->video.driver);
switch (driver_hash)
@ -281,6 +283,7 @@ int menu_hash_get_help_us(uint32_t hash, char *s, size_t len)
);
break;
case MENU_LABEL_AUDIO_RESAMPLER_DRIVER:
if (settings)
driver_hash = msg_hash_calculate(settings->audio.resampler);
switch (driver_hash)