diff --git a/command.c b/command.c index a4e1f2c10f..ea2e9e15a4 100644 --- a/command.c +++ b/command.c @@ -1024,7 +1024,7 @@ static void command_event_init_controllers(void) /* Ideally these checks shouldn't be required but if we always * call core_set_controller_port_device input won't work on * cores that don't set port information properly */ - if (info->ports.size != 0 && i < info->ports.size) + if (info && info->ports.size != 0 && i < info->ports.size) set_controller = true; break; default: diff --git a/libretro-common/audio/dsp_filter.c b/libretro-common/audio/dsp_filter.c index 7ff162f325..0b695ec87e 100644 --- a/libretro-common/audio/dsp_filter.c +++ b/libretro-common/audio/dsp_filter.c @@ -179,8 +179,9 @@ static bool append_plugs(retro_dsp_filter_t *dsp, struct string_list *list) { unsigned i; dspfilter_simd_mask_t mask = cpu_features_get(); + unsigned list_size = list ? list->size : 0; - for (i = 0; i < list->size; i++) + for (i = 0; i < list_size; i++) { dspfilter_get_implementation_t cb; const struct dspfilter_implementation *impl = NULL; diff --git a/libretro-common/audio/resampler/audio_resampler.c b/libretro-common/audio/resampler/audio_resampler.c index 06dad76242..a7cc0c2f47 100644 --- a/libretro-common/audio/resampler/audio_resampler.c +++ b/libretro-common/audio/resampler/audio_resampler.c @@ -131,7 +131,8 @@ static bool resampler_append_plugs(void **re, { resampler_simd_mask_t mask = (resampler_simd_mask_t)cpu_features_get(); - *re = (*backend)->init(&resampler_config, bw_ratio, mask); + if (*backend) + *re = (*backend)->init(&resampler_config, bw_ratio, mask); if (!*re) return false;