diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 205022a4b8..43c9f6a090 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -611,14 +611,16 @@ static bool init_video_pixel_converter(unsigned size) return true; error: - if (video_driver_scaler_ptr->scaler_out) - free(video_driver_scaler_ptr->scaler_out); - if (video_driver_scaler_ptr->scaler) - free(video_driver_scaler_ptr->scaler); if (video_driver_scaler_ptr) - free(video_driver_scaler_ptr); + { + if (video_driver_scaler_ptr->scaler_out) + free(video_driver_scaler_ptr->scaler_out); + if (video_driver_scaler_ptr->scaler) + free(video_driver_scaler_ptr->scaler); - video_driver_scaler_ptr = NULL; + free(video_driver_scaler_ptr); + video_driver_scaler_ptr = NULL; + } return false; } diff --git a/gfx/video_texture_c.c b/gfx/video_texture_c.c index 8f90cdd181..a6f1e02b6a 100644 --- a/gfx/video_texture_c.c +++ b/gfx/video_texture_c.c @@ -242,8 +242,10 @@ unsigned video_texture_load(void *data, static void video_texture_gl_unload(uintptr_t *id) { if (id) + { glDeleteTextures(1, (const GLuint*)id); - *id = 0; + *id = 0; + } } #endif diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index fa9ef8d754..7a71a3e3b8 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -56,8 +56,11 @@ static void print_buf_lines(file_list_t *list, char *buf, int buf_size, int i, j = 0; char *line_start = buf; - if (!buf) + if (!buf || !buf_size) + { menu_entries_push(list, "No entries to display.", "", MENU_FILE_NONE, 0, 0); + return; + } for (i = 0; i < buf_size; i++) {