[libpng16] Fixed the simplified API example programs and improved the error

message if the version field is not set.
This commit is contained in:
John Bowler
2012-08-31 17:32:36 -05:00
committed by Glenn Randers-Pehrson
parent fd043e5d0d
commit ed3ca0e3eb
5 changed files with 47 additions and 6 deletions

View File

@@ -2248,6 +2248,10 @@ png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
"png_image_write_to_stdio: invalid argument");
}
else if (image != NULL)
return png_image_error(image,
"png_image_write_to_stdio: incorrect PNG_IMAGE_VERSION");
else
return 0;
}
@@ -2311,6 +2315,10 @@ png_image_write_to_file(png_imagep image, const char *file_name,
"png_image_write_to_file: invalid argument");
}
else if (image != NULL)
return png_image_error(image,
"png_image_write_to_file: incorrect PNG_IMAGE_VERSION");
else
return 0;
}