X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36308e0e02bc392eaf9bdb34dbfec048b0d13c9f..194142ed6fec5b7bc09e19b093db3e5d56f3ebc4:/src/common/imagpng.cpp diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 66e917422a..151d3c9986 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -11,7 +11,7 @@ // declarations // ============================================================================ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "imagpng.h" #endif @@ -220,14 +220,13 @@ CheckTransparency(unsigned char **lines, png_uint_32 x, png_uint_32 y, png_uint_32 w, png_uint_32 h, size_t numColBytes) { - // we start from (x + 1, y) - x++; - // suppose that a mask will suffice and check all the remaining alpha // values to see if it does for ( ; y < h; y++ ) { - unsigned const char *ptr = lines[y] + x; + // each pixel is numColBytes+1 bytes, offset into the current line by + // the current x position + unsigned const char *ptr = lines[y] + (x * (numColBytes + 1)); for ( png_uint_32 x2 = x; x2 < w; x2++ ) {