fix some bugs found through Clang Static Analyzer:
- task_content.c, load_content_from_compressed_archive: fix use after free - platform_win32/uwp: fix frontend_..._get_powerstate never returning FRONTEND_POWERSTATE_NONE - platform_win32/uwp: fix whitespace - cheevos.c: fix potential use after free in a loop, just to be save
This commit is contained in:
parent
3cbb495bd2
commit
f5497a4249
|
@ -1771,7 +1771,10 @@ found:
|
|||
coro->json, coro->k))
|
||||
CHEEVOS_ERR(RCHEEVOS_TAG "error writing badge %s\n", coro->badge_fullpath);
|
||||
else
|
||||
{
|
||||
CHEEVOS_FREE(coro->json);
|
||||
coro->json = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ enum frontend_powerstate frontend_uwp_get_powerstate(
|
|||
|
||||
if (status.BatteryFlag == 0xFF)
|
||||
ret = FRONTEND_POWERSTATE_NONE;
|
||||
if (status.BatteryFlag & (1 << 7))
|
||||
else if (status.BatteryFlag & (1 << 7))
|
||||
ret = FRONTEND_POWERSTATE_NO_SOURCE;
|
||||
else if (status.BatteryFlag & (1 << 3))
|
||||
ret = FRONTEND_POWERSTATE_CHARGING;
|
||||
|
@ -234,6 +234,7 @@ enum frontend_powerstate frontend_uwp_get_powerstate(
|
|||
if (*percent == 255)
|
||||
*percent = 0;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -347,7 +347,7 @@ enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percen
|
|||
|
||||
if (status.BatteryFlag == 0xFF)
|
||||
ret = FRONTEND_POWERSTATE_NONE;
|
||||
if (status.BatteryFlag & (1 << 7))
|
||||
else if (status.BatteryFlag & (1 << 7))
|
||||
ret = FRONTEND_POWERSTATE_NO_SOURCE;
|
||||
else if (status.BatteryFlag & (1 << 3))
|
||||
ret = FRONTEND_POWERSTATE_CHARGING;
|
||||
|
@ -363,6 +363,7 @@ enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percen
|
|||
if (*percent == 255)
|
||||
*percent = 0;
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -557,8 +557,6 @@ static uintptr_t gdi_load_texture(void *video_data, void *data,
|
|||
void *tmpdata = NULL;
|
||||
gdi_texture_t *texture = NULL;
|
||||
struct texture_image *image = (struct texture_image*)data;
|
||||
int size = image->width *
|
||||
image->height * sizeof(uint32_t);
|
||||
|
||||
if (!image || image->width > 2048 || image->height > 2048)
|
||||
return 0;
|
||||
|
|
|
@ -453,12 +453,15 @@ static bool load_content_from_compressed_archive(
|
|||
info[i].path =
|
||||
additional_path_allocs->elems[additional_path_allocs->size - 1].data;
|
||||
|
||||
free(new_path);
|
||||
|
||||
if (!string_list_append(content_ctx->temporary_content,
|
||||
new_path, attributes))
|
||||
{
|
||||
free(new_path);
|
||||
return false;
|
||||
}
|
||||
|
||||
free(new_path);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue