Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#170 [1.5.2 regression] PNG_TRANSFORM_STRIP_FILLER_AFTER broken

libpng_code
closed-fixed
5
2011-07-10
2011-04-16
Andrew Church
No

When passing the PNG_TRANSFORM_STRIP_FILLER_AFTER flag to png_write_png(), libpng 1.5.2 incorrectly strips the first byte of each pixel rather than the last one. For example, given the byte sequence 0x12 0x34 0x56 0x78 for a pixel in RGBA byte order, libpng 1.5.2 incorrectly writes a pixel with R=0x34 G=0x56 B=0x78, while libpng 1.5.1 acts correctly (storing R=0x12 G=0x34 B=0x56 in this example).

Discussion

    • assigned_to: nobody --> glennrp
     
  • It looks as though some of the PNG flags were mixed up.
    The new calls to png_do_strip_channel look like this:

    png_do_strip_channel(&(png_ptr->row_info), png_ptr->row_buf + 1,
    !(png_ptr->flags & PNG_FILLER_AFTER));

    Shouldn't that be PNG_FLAG_FILLER_AFTER ? PNG_FILLER_AFTER
    is 0x1, but the 0x1 bit in png_ptr->flags is the flag for ZLIB_CUSTOM_STRATEGY.

     
    • status: open --> open-accepted
     
  • Andrew, please try libpng-1.5.3beta04.

     
  • Andrew Church
    Andrew Church
    2011-04-17

    I assume you meant 1.5.3beta03? I've just tried it and can confirm that it fixes this problem. Thanks!

     
  • Yes, beta03. Thanks for the report.

     
  • fixed in libpng-1.5.3beta03. Thanks.

     
    • status: open-accepted --> open-fixed
     
    • status: open-fixed --> closed-fixed
     
  • Fixed in libpng-1.5.4.