Skip to content
  • Jehan's avatar
    Issue #8385: problem importing SVG containing huge data. · 240dc129
    Jehan authored
    libxml has a XML_PARSE_HUGE parsing option, which can be turned on with
    the RSVG_HANDLE_FLAG_UNLIMITED option in librsvg.
    We cannot just set this option by default because it is a security
    hazard as a maliciously malformed SVG could use this to consume too much
    memory.
    
    Instead, let's just propose the option interactively when we fail to
    create a rsvg handle. Unfortunately right now we can't single out this
    specific error because librsvg actually returns an unrelated (false
    positive created by the huge data) error. So we just propose the option
    for any kind of handle creation failure.
    
    Furthermore, the option is only available on interactive plug-in calls
    so far. In particular, the PDB API doesn't have an option allowing a
    script writer to run "file-svg-load" with the huge data option.
    
    As for the thumbnail API, it is never meant to be used interactively and
    not really as a common script function, so it won't have the huge data
    option either.
    240dc129