if (png_ptr->error_fn != NULL)
if (png_ptr != NULL && png_ptr->error_fn != NULL)
png_error(png_structp png_ptr, png_const_charp error_message){#ifdef PNG_ERROR_NUMBERS_SUPPORTED   char msg[16];   if (png_ptr->flags&(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))   {     int offset = 0;     if (*error_message == '#')     {         for (offset=1; offset<15; offset++)            if (*(error_message+offset) == ' ')                break;         if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)         {            int i;            for (i=0; i<offset-1; i++)               msg[i]=error_message[i+1];            msg[i]='\0';            error_message=msg;         }         else            error_message+=offset;     }     else     {         if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT)         {            msg[0]='0';                    msg[1]='\0';            error_message=msg;         }     }   }#endif   if (png_ptr->error_fn != NULL)      (*(png_ptr->error_fn))(png_ptr, error_message);   /* if the following returns or doesn't exist, use the default function,      which will not return */   png_default_error(png_ptr, error_message);}