Index: src/cairo-png.c =================================================================== RCS file: /cvs/cairo/cairo/src/cairo-png.c,v retrieving revision 1.6 diff -u -r1.6 cairo-png.c --- src/cairo-png.c 7 Apr 2005 19:56:43 -0000 1.6 +++ src/cairo-png.c 19 Apr 2005 02:03:10 -0000 @@ -242,7 +242,7 @@ png_byte **row_pointers; sig_bytes = fread (png_sig, 1, PNG_SIG_SIZE, file); - if (png_check_sig (png_sig, sig_bytes) == 0) + if (sig_bytes != PNG_SIG_SIZE || png_check_sig (png_sig, sig_bytes) == 0) goto BAIL1; /* FIXME: ERROR_NOT_PNG */ /* XXX: Perhaps we'll want some other error handlers? */