diff --git a/pdfio-array.c b/pdfio-array.c index 6ba7525..3497731 100644 --- a/pdfio-array.c +++ b/pdfio-array.c @@ -363,6 +363,9 @@ _pdfioArrayDebug(pdfio_array_t *a, // I - Array _pdfio_value_t *v; // Current value + if (!a) + return; + putc('[', fp); for (i = a->num_values, v = a->values; i > 0; i --, v ++) _pdfioValueDebug(v, fp); diff --git a/pdfio-dict.c b/pdfio-dict.c index 7fe5291..a0b4240 100644 --- a/pdfio-dict.c +++ b/pdfio-dict.c @@ -194,6 +194,9 @@ _pdfioDictDebug(pdfio_dict_t *dict, // I - Dictionary _pdfio_pair_t *pair; // Current pair + if (!dict) + return; + for (i = dict->num_pairs, pair = dict->pairs; i > 0; i --, pair ++) { fprintf(fp, "/%s", pair->key); diff --git a/pdfio-value.c b/pdfio-value.c index 6a7ed3a..9fe960f 100644 --- a/pdfio-value.c +++ b/pdfio-value.c @@ -215,6 +215,9 @@ void _pdfioValueDebug(_pdfio_value_t *v, // I - Value FILE *fp) // I - Output file { + if (!v) + return; + switch (v->type) { case PDFIO_VALTYPE_ARRAY :