mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Add/fix some trivial null checks
This commit is contained in:
parent
9428765596
commit
ee80a34974
@ -44,6 +44,9 @@ static void rxml_free_node(struct rxml_node *node)
|
|||||||
struct rxml_node *head = NULL;
|
struct rxml_node *head = NULL;
|
||||||
struct rxml_attrib_node *attrib_node_head = NULL;
|
struct rxml_attrib_node *attrib_node_head = NULL;
|
||||||
|
|
||||||
|
if (!node)
|
||||||
|
return;
|
||||||
|
|
||||||
for (head = node->children; head; )
|
for (head = node->children; head; )
|
||||||
{
|
{
|
||||||
struct rxml_node *next_node = (struct rxml_node*)head->next;
|
struct rxml_node *next_node = (struct rxml_node*)head->next;
|
||||||
|
@ -1464,6 +1464,9 @@ static void d3d_overlay_enable(void *data, bool state)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
|
|
||||||
|
if (!d3d)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < d3d->overlays.size(); i++)
|
for (i = 0; i < d3d->overlays.size(); i++)
|
||||||
d3d->overlays_enabled = state;
|
d3d->overlays_enabled = state;
|
||||||
|
|
||||||
|
@ -91,13 +91,13 @@ static void lakka_draw_text(lakka_handle_t *lakka,
|
|||||||
const char *str, float x,
|
const char *str, float x,
|
||||||
float y, float scale_factor, float alpha)
|
float y, float scale_factor, float alpha)
|
||||||
{
|
{
|
||||||
|
if (!lakka)
|
||||||
|
return;
|
||||||
|
|
||||||
if (alpha > lakka->global_alpha)
|
if (alpha > lakka->global_alpha)
|
||||||
alpha = lakka->global_alpha;
|
alpha = lakka->global_alpha;
|
||||||
uint8_t a8 = 255 * alpha;
|
uint8_t a8 = 255 * alpha;
|
||||||
|
|
||||||
if (!lakka)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (a8 == 0)
|
if (a8 == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user