mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-08 19:40:30 +00:00
Merge pull request #2518 from heuripedes/master
Fix some potential null derefs
This commit is contained in:
commit
8c6f0be6e9
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user