summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-05-24 11:16:46 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-05-24 11:17:41 -0400
commit8825b330529a1cc1a74bb0b4f6880fbdd4333b22 (patch)
tree70a373a62f37dabf14fb9375f6a14085ebd1bf0e
parent2dc6947a2db18f7566e1f6ebd0282b0412b258ac (diff)
downloadrockbox-8825b33052.tar.gz
rockbox-8825b33052.zip
skin_debug: Don't segfault when dump a viewport with no children
Change-Id: I5dfcc53a735dab1552211cdf522f4d18d93e6ec8
-rw-r--r--lib/skin_parser/skin_debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/skin_parser/skin_debug.c b/lib/skin_parser/skin_debug.c
index ff26819bc0..e1746023b3 100644
--- a/lib/skin_parser/skin_debug.c
+++ b/lib/skin_parser/skin_debug.c
@@ -43,6 +43,9 @@ static char* error_message;
static inline struct skin_element*
get_child(OFFSETTYPE(struct skin_element**) children, int child)
{
+ if (children == NULL)
+ return NULL;
+
struct skin_element **kids = SKINOFFSETTOPTR(skin_buffer, children);
return kids[child];
}
@@ -266,7 +269,7 @@ void skin_debug_params(int count, struct skin_tag_parameter params[])
case INTEGER:
printf("integer: %d", params[i].data.number);
break;
-
+
case DECIMAL:
printf("decimal: %d.%d", params[i].data.number/10,
params[i].data.number%10);