mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
Imported from libpng-1.4.0beta9.tar
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user