Skip to content
  • Ell's avatar
    Issue #1682 - Segfault when starting GIMP, due to empty data files · 993bbd35
    Ell authored
    Use gimp_input_data_stream_read_line_always(), instead of
    g_input_data_stream_read_line(), in a bunch of places that don't
    expect EOF.  If we don't do that, the code assumes the GError
    parameter is set by the function and returns an error indication,
    causing the caller to segfault when it tries to access
    error->message.  Instead, we now process an empty line when EOF is
    reached, which is caught by the normal parsing logic.
    
    Additionally:
    
      - Use gimp_ascii_strto[id]() when loading gradients, generated
        brushes, and palettes, to improve error checking for invalid
        numeric input.
    
      - Improve gradient-segment endpoint consistency check.
    
      - Allow loading palette files with 0 colors.  They can be created
        during the session, so we might as well successfully load them.
    993bbd35