format: handle NULL type info

This commit is contained in:
Wim Taymans 2020-05-20 13:28:18 +02:00
parent d2c51ed2fc
commit 1b2f64917e

View file

@ -163,7 +163,7 @@ static inline int spa_debug_format(int indent,
rindex(spa_types[type].name, ':') + 1); rindex(spa_types[type].name, ':') + 1);
if (choice == SPA_CHOICE_None) { if (choice == SPA_CHOICE_None) {
spa_debug_format_value(ti->values, type, vals, size); spa_debug_format_value(ti ? ti->values : NULL, type, vals, size);
} else { } else {
const char *ssep, *esep, *sep; const char *ssep, *esep, *sep;
@ -189,7 +189,7 @@ static inline int spa_debug_format(int indent,
vals = SPA_MEMBER(vals, size, void); vals = SPA_MEMBER(vals, size, void);
if (i > 1) if (i > 1)
fprintf(stderr, "%s", sep); fprintf(stderr, "%s", sep);
spa_debug_format_value(ti->values, type, vals, size); spa_debug_format_value(ti ? ti->values : NULL, type, vals, size);
} }
fprintf(stderr, "%s", esep); fprintf(stderr, "%s", esep);
} }