Imported from libpng-1.4.0beta9.tar

This commit is contained in:
Glenn Randers-Pehrson
2006-07-03 00:21:58 -05:00
parent d120996a49
commit e826d7e200
47 changed files with 342 additions and 394 deletions

View File

@@ -19,7 +19,15 @@
png_uint_32 PNGAPI
png_get_uint_31(png_structp png_ptr, png_bytep buf)
{
#ifdef PNG_READ_BIG_ENDIAN_SUPPORTED
png_uint_32 i = png_get_uint_32(buf);
#else
/* Avoid an extra function call by inlining the result. */
png_uint_32 i = ((png_uint_32)(*buf) << 24) +
((png_uint_32)(*(buf + 1)) << 16) +
((png_uint_32)(*(buf + 2)) << 8) +
(png_uint_32)(*(buf + 3));
#endif
if (i > PNG_UINT_31_MAX)
png_error(png_ptr, "PNG unsigned integer out of range.");
return (i);