diff --git a/src/diag.c b/src/diag.c index d97be9b96b..8512063a2e 100644 --- a/src/diag.c +++ b/src/diag.c @@ -9,7 +9,9 @@ void avifDiagnosticsClearError(avifDiagnostics * diag) { - *diag->error = '\0'; + if (diag) { + *diag->error = '\0'; + } } #ifdef __clang__ @@ -18,7 +20,6 @@ __attribute__((__format__(__printf__, 2, 3))) void avifDiagnosticsPrintf(avifDiagnostics * diag, const char * format, ...) { if (!diag) { - // It is possible this is NULL (e.g. calls to avifFileTypeIsCompatible()) return; } if (*diag->error) {