mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Fixed the simplified API example programs and improved the error
message if the version field is not set.
This commit is contained in:
committed by
Glenn Randers-Pehrson
parent
fd043e5d0d
commit
ed3ca0e3eb
16
pngread.c
16
pngread.c
@@ -1357,6 +1357,10 @@ png_image_begin_read_from_stdio(png_imagep image, FILE* file)
|
||||
"png_image_begin_read_from_stdio: invalid argument");
|
||||
}
|
||||
|
||||
else if (image != NULL)
|
||||
return png_image_error(image,
|
||||
"png_image_begin_read_from_stdio: incorrect PNG_IMAGE_VERSION");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1391,6 +1395,10 @@ png_image_begin_read_from_file(png_imagep image, const char *file_name)
|
||||
"png_image_begin_read_from_file: invalid argument");
|
||||
}
|
||||
|
||||
else if (image != NULL)
|
||||
return png_image_error(image,
|
||||
"png_image_begin_read_from_file: incorrect PNG_IMAGE_VERSION");
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* PNG_STDIO_SUPPORTED */
|
||||
@@ -1452,6 +1460,10 @@ int PNGAPI png_image_begin_read_from_memory(png_imagep image,
|
||||
"png_image_begin_read_from_memory: invalid argument");
|
||||
}
|
||||
|
||||
else if (image != NULL)
|
||||
return png_image_error(image,
|
||||
"png_image_begin_read_from_memory: incorrect PNG_IMAGE_VERSION");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3954,6 +3966,10 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
|
||||
"png_image_finish_read: invalid argument");
|
||||
}
|
||||
|
||||
else if (image != NULL)
|
||||
return png_image_error(image,
|
||||
"png_image_finish_read: damaged PNG_IMAGE_VERSION");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user