exyte / Macaw

Powerful and easy-to-use vector graphics Swift library with SVG support
MIT License
6.02k stars 556 forks source link

SVGParser crashed on specific SVG file #662

Open zalexej opened 4 years ago

zalexej commented 4 years ago

0 0x000000010d55d9d9 in SVGParser.parsePattern(_:) at Pods/Macaw/Source/svg/SVGParser.swift:389

1 0x000000010d5545b6 in SVGParser.prepareSvg(_:) at Pods/Macaw/Source/svg/SVGParser.swift:162

2 0x000000010d553b6a in closure #1 in SVGParser.prepareSvg(_:) at Pods/Macaw/Source/svg/SVGParser.swift:144

3 0x000000010d58556f in partial apply for closure #1 in SVGParser.prepareSvg(_:) ()

4 0x000000010d553bec in thunk for @callee_guaranteed (@guaranteed XMLIndexer) -> (@error @owned Error) ()

5 0x000000010d585594 in thunk for @callee_guaranteed (@guaranteed XMLIndexer) -> (@error @owned Error)partial apply ()

6 0x000000010f4cda74 in Sequence.forEach(_:) ()

7 0x000000010d553ad5 in SVGParser.prepareSvg(_:) at Pods/Macaw/Source/svg/SVGParser.swift:143

8 0x000000010d552d27 in SVGParser.parse() at Pods/Macaw/Source/svg/SVGParser.swift:128

9 0x000000010d550b42 in static SVGParser.parse(text:) at Pods/Macaw/Source/svg/SVGParser.swift:77

meta_property-og_image.svg.zip

amarunko commented 4 years ago

Hi, @zalexej, can you check on the master branch? For me, everything works as expected.

zalexej commented 4 years ago

Mentioned SVG image works on master. But I have some different crashes on master with another SVG images (see attached images with correspondent names). 1) Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Macaw/Source/render/NodeRenderer.swift, line 258 2) Fatal error: Unexpectedly found nil while unwrapping an Optional value: file Macaw/Source/utils/CGMappings.swift, line 152 svg-macaw-crashed-while-parsing.zip