Add/fix some trivial null checks

This commit is contained in:
Lioncash 2014-11-14 23:06:34 -05:00
parent 9428765596
commit ee80a34974
3 changed files with 9 additions and 3 deletions

View File

@ -44,6 +44,9 @@ static void rxml_free_node(struct rxml_node *node)
struct rxml_node *head = NULL;
struct rxml_attrib_node *attrib_node_head = NULL;
if (!node)
return;
for (head = node->children; head; )
{
struct rxml_node *next_node = (struct rxml_node*)head->next;

View File

@ -1464,6 +1464,9 @@ static void d3d_overlay_enable(void *data, bool state)
unsigned i;
d3d_video_t *d3d = (d3d_video_t*)data;
if (!d3d)
return;
for (i = 0; i < d3d->overlays.size(); i++)
d3d->overlays_enabled = state;

View File

@ -91,13 +91,13 @@ static void lakka_draw_text(lakka_handle_t *lakka,
const char *str, float x,
float y, float scale_factor, float alpha)
{
if (!lakka)
return;
if (alpha > lakka->global_alpha)
alpha = lakka->global_alpha;
uint8_t a8 = 255 * alpha;
if (!lakka)
return;
if (a8 == 0)
return;