Skip to content

Crash opening SVGs with old mesh gradients (or any with missing path)

Summary:

The file http://tavmjong.free.fr/SVG/MESH/mesh_wild.svg crashes Inksacpe when opened or previewed in the File Open dialog.

Steps to reproduce:

  • Download the above file.
  • Open Inkscape.
  • Open the file, or navigate to it in the File Open dialog with the previewer enabled.

What happened?

Crash in SPMeshNodeArray::read, with no crash dialog, and backtrace

Backtrace
1   std::string::basic_string      basic_string.h    544  0x5555555580e5 
2   SPMeshNodeArray::read          ustring.h         1354 0x7ffff676c15c 
3   SPGradient::rebuildArray       sp-gradient.cpp   1069 0x7ffff673e1fe 
4   SPGradient::ensureArray        sp-gradient.cpp   711  0x7ffff673e253 
5   SPGradient::modified           sp-gradient.cpp   555  0x7ffff673fa09 
6   SPObject::emitModified         sp-object.cpp     1481 0x7ffff67895be 
7   SPDefs::modified               sp-defs.cpp       68   0x7ffff67185c7 
8   SPObject::emitModified         sp-object.cpp     1481 0x7ffff67895be 
9   SPGroup::modified              sp-item-group.cpp 209  0x7ffff674ed5a 
10  SPRoot::modified               sp-root.cpp       297  0x7ffff679609c 
11  SPObject::emitModified         sp-object.cpp     1481 0x7ffff67895be 
12  SPDocument::_emitModified      document.cpp      2158 0x7ffff6c746c5 
13  SPDocument::_updateDocument    document.cpp      1346 0x7ffff6c74763 
14  SPDocument::idle_handler       document.cpp      1403 0x7ffff6c7485b 
... <More>

Version info

Reproduced on a custom build of 1.3 based on current master (inkscape@4e7f24b7), as well as 1.1 with version info

Inkscape 1.1.2 (0a00cf5339, 2022-02-04, custom)
Edited by Nathan Lee
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information