Skip to content
  • Uli Schlachter's avatar
    _cairo_surface_create_in_error(): Add PNG_ERROR support · 23a643c8
    Uli Schlachter authored
    Traditionally, loading a malformed PNG file with
    cairo_image_surface_create_from_png() resulted in
    CAIRO_STATUS_NO_MEMORY. This was apparently changed in commit
    c5ee3f11
    
     by adding CAIRO_STATUS_PNG_ERROR and using it for errors
    returned from libpng. However, I don't see how this was supposed to
    actually work.
    
    There are a couple of error codes supported by
    _cairo_surface_create_in_error(). Anything else is turned into
    CAIRO_STATUS_NO_MEMORY, which is not a helpful status. For this reason,
    CAIRO_STATUS_PNG_ERROR would be turned into CAIRO_STATUS_NO_MEMORY.
    
    This commit adds support for CAIRO_STATUS_PNG_ERROR to
    _cairo_surface_create_in_error() so that this error can actually be
    returned to the caller.
    
    Signed-off-by: default avatarUli Schlachter <psychon@znc.in>
    23a643c8