From: Vadim Zeitlin Date: Sat, 5 Feb 2011 20:24:52 +0000 (+0000) Subject: Correct decoding of 4-byte integers in png2c script. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a8bda512079352ba81933e278d9ccdb8ef7a9866 Correct decoding of 4-byte integers in png2c script. Wrong multiplier was used for the most significant byte. Fix it even though it doesn't risk to be a problem in practice as the images of such gigantic size would surely break some limit anyhow. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/misc/scripts/png2c.py b/misc/scripts/png2c.py index 5f451aa05d..fe96def079 100755 --- a/misc/scripts/png2c.py +++ b/misc/scripts/png2c.py @@ -56,8 +56,8 @@ for path in sys.argv[1:]: # Try to naively get its size if necessary if with_size: - width = bytes[19] + 16*bytes[18] + 256*bytes[17] + 4096*bytes[16] - height = bytes[23] + 16*bytes[22] + 256*bytes[21] + 4096*bytes[20] + width = bytes[19] + 16*bytes[18] + 256*bytes[17] + 65536*bytes[16] + height = bytes[23] + 16*bytes[22] + 256*bytes[21] + 65536*bytes[20] size_suffix = "_%dx%d" % (width, height) # Create the C header