Skip to content
  • Jacob Boerema's avatar
    app: fix #3928 GIMP cannot open .xcf · e4d8a91f
    Jacob Boerema authored
    GIMP stopped trying to read the XCF as soon as an invalid parasite was
    encountered. However, in this specific case only the parasite data is
    invalid, while the rest of the image is not corrupt.
    
    Instead of terminating when we see a corrupt parasite, we skip to the
    offset after the parasite. This may still be corrupt, but we can handle
    that correctly, see e.g. the XCF in bugzilla issue 685086, which was
    the reason of some of the previous changes.
    
    Additionally:
    - We add some logging to make it easier to handle future issues in this
      area.
    - We add tests for a NULL parasite name, and for reading a different
      amount of parasite data than we expected. In both cases we return
      NULL instead of a parasite.
    
    (cherry picked from commit 5b39bc96)
    e4d8a91f