fpvectorials svgreader crash
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
As discussed in the forum (http://forum.lazarus.freepascal.org/index.php/topic,29621.0.html) it seems to be within svg specification if no separating space or comma is placed before a negative number, e.g. using "15-15" instead of "15 -15" or "15,-15". I am not 100% sure about this statement, but Firefox definitely can read the "malformed" files appended to the forum discussion. The svgreader of fpvectorial, however, cannot. The tokenizer crashes when trying to convert these strings to numerical values.
The attached patch splits strings like "15-15" at the "-" character into its parts "15" and "-15" and makes these files readable by fpvectorial.
In tests with Firefox I saw that a "+" character can be used in the same way. Therefore, the patch handles this case as well.
Steps to reproduce:
Run attached demo (which is adapted from the forum discussion).
Additional information:
Felipe, I could apply the fix by myself, but since I am not too familiar with fpvectorial I would like you to have a look at it. Please leave me a note if you want me to apply patches to fpvectorial by myself in the future. (BTW, there's a bunch of memory leaks).
Mantis conversion info:
- Mantis ID: 28659
- Version: 1.5 (SVN)
- Fixed in version: 1.6
- Target version: 1.6