Menu

#324 GM returns MagickFail, when raw profile length is 0.

v1.0_(example)
closed-fixed
PNG (3)
5
2015-11-07
2015-11-03
alien
No

When encouting a 'raw profile type' while reading a png file, the gm code always have a judgement that whether the profile length equals 0, if 0, return MagickFail. Howecer, if this profile is just a futile label, the gm could not process this file.

Discussion

  • alien

    alien - 2015-11-03

    I suggest that the gm could return MagickTrue in png_read_raw_profile function when encounting profile length 0, without set this image profile. For myself, I have ecncoutered some png image which hold this problem.

     

    Last edit: alien 2015-11-03
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-11-03

    The calling code is not checking the return status from png_read_raw_profile(). The error returned to the user is due to a CoderError exception being thrown at line 1150 of png.c. Perhaps it would work better if a warning was thrown instead. Unfortunately, the internal design of GM does not allow storing empty profiles.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-11-03

    It would be very helpful if the problematic PNG was attached to this bug report, bundled up as a zip archive in order to prevent SourceForge from modifying it.

     
  • alien

    alien - 2015-11-04

    The attachment is 3 problematic PNG images. These PNG have a 0 length profile. So, in 1150, GM throw a CoderError exception. All these images look right in browser or a system photo viewer. That's why I suggest that GM could just ignore this profile with 0 length.

     
  • Glenn Randers-Pehrson

    I've pushed a fix to coders/png.c for Bob's review. GM will issue a warning about the profile and will then proceed to convert the image without copying the bad profile. The other profiles in the image are preserved.

     

    Last edit: Glenn Randers-Pehrson 2015-11-04
  • alien

    alien - 2015-11-04

    Thanks for your adoption of my suggestion. I have some other questions about GM, which I will open new tickets.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-11-07
    • status: open --> closed-fixed
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2015-11-07

    I am satisfied with Glenn's fix. All seems good. Valgrind is happy.

     

Log in to post a comment.

MongoDB Logo MongoDB