Imported from libpng-1.2.1beta4.tar
diff --git a/pngwrite.c b/pngwrite.c
index 9301fd8..d0331e3 100644
--- a/pngwrite.c
+++ b/pngwrite.c
@@ -1,7 +1,7 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * libpng 1.2.1beta3 - October 27, 2001
+ * libpng 1.2.1beta4 - November 7, 2001
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2001 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -502,7 +502,7 @@
              user_png_ver);
           png_warning(png_ptr, msg);
         }
-        sprintf(msg, "Application  is running with png.c from libpng-%.20s",
+        sprintf(msg, "Application  is  running with png.c from libpng-%.20s",
            png_libpng_ver);
         png_warning(png_ptr, msg);
 #endif
@@ -556,7 +556,7 @@
            user_png_ver);
         png_warning(png_ptr, msg);
       }
-      sprintf(msg, "Application  is running with png.c from libpng-%.20s",
+      sprintf(msg, "Application  is  running with png.c from libpng-%.20s",
          png_libpng_ver);
       png_warning(png_ptr, msg);
    }
@@ -705,6 +705,11 @@
    /* initialize transformations and other stuff if first time */
    if (png_ptr->row_number == 0 && png_ptr->pass == 0)
    {
+   /* make sure we wrote the header info */
+   if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE))
+      png_error(png_ptr,
+         "png_write_info was never called before png_write_row.");
+
    /* check for transforms that have been set but were defined out */
 #if !defined(PNG_WRITE_INVERT_SUPPORTED) && defined(PNG_READ_INVERT_SUPPORTED)
    if (png_ptr->transformations & PNG_INVERT_MONO)