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

View File

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

View File

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

View File

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

View File

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