Revert "Guard diag in avifDiagnosticsClearError()" This reverts commit 173961dac588d5b7cf0d6749d1aada9050b6197a in the 1.0.0 release, to give us more time to re-evaluate https://github.com/AOMediaCodec/libavif/pull/1496.
diff --git a/src/diag.c b/src/diag.c index 8512063..8537018 100644 --- a/src/diag.c +++ b/src/diag.c
@@ -9,9 +9,7 @@ void avifDiagnosticsClearError(avifDiagnostics * diag) { - if (diag) { - *diag->error = '\0'; - } + *diag->error = '\0'; } #ifdef __clang__ @@ -20,6 +18,7 @@ void avifDiagnosticsPrintf(avifDiagnostics * diag, const char * format, ...) { if (!diag) { + // It is possible this is NULL (e.g. calls to avifPeekCompatibleFileType()) return; } if (*diag->error) {