Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Using PNG gamma causes crash when loading bright.png #567

Closed

Description

@ljbade

I have encountered a crash while loading the sprite PNG file. It is caused by a C++ runtime_exception raised when libpng throws an error in png_set_alpha_mode.

The error from libpng: E/Image﹕ PNG: output gamma out of expected range
See pngrtran.c line 293

So I ave disabled PNG gamma for now: f01428b

Activity

  1. added
    Android
    on Nov 7, 2014
  2. added this to the Android merge milestone on Nov 13, 2014
  3. ljbade commented on Nov 16, 2014

    @ljbade
    ContributorAuthor

    Curious, the gamma read from the PNG seems too large:

    Breakpoint 5, mbgl::util::Image::Image (this=0x6b10a4e8, data=...) at ../../platform/default/image.cpp:153
    153         if (png_get_gAMA(png, info, &gamma))
    (gdb) n
    156         png_set_alpha_mode(png, PNG_ALPHA_PREMULTIPLIED, 2.2);
    (gdb) p gamma
    $1 = 5.9618871016638681e+207
    
  4. ljbade commented on Nov 16, 2014

    @ljbade
    ContributorAuthor

    Nevermind, it runs out there is no gamma value so the variable was uninitialised.

  5. ljbade commented on Nov 16, 2014

    @ljbade
    ContributorAuthor

    Hmm, can't recreate the crash it seems to have disappeared?

    @kkaefer any ideas as to what might have fixed the crash?

  6. ljbade commented on Nov 16, 2014

    @ljbade
    ContributorAuthor

    I enabled gamma again - d957d65

  7. ljbade commented on Feb 10, 2015

    @ljbade
    ContributorAuthor

    Its back!

  8. reopened this on Feb 10, 2015
  9. ljbade commented on Feb 10, 2015

    @ljbade
    ContributorAuthor

    I wonder if we are somehow getting garbage/corrupted png files? commenting out the gamma load seems to work so not sure why only gamma info is bad.

  10. removed this from the Android merge milestone on Feb 13, 2015
  11. added this to the milestone on Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions