Path data not correctly read

Bug #167129 reported by Atwupack
2
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

If the d attribute of a path contains values starting
with . instead of a digit or sign, these values are
parsed incorrectly. The dot is ignored and you get a
large integer instead.
As example I attach a small SVG wicht contains a circle
drawn by using a path element.
I did a rather dirty fix of it in svg-path.cpp. You can
find the patch as second attchment.

Revision history for this message
Atwupack (atwupack) wrote :
Revision history for this message
Atwupack (atwupack) wrote : Patch of src/svg/svg-path.cpp

Other attachments

Revision history for this message
Peter Moulder (pjrm) wrote :

I've confirmed that the SVG spec allows initial dot in
numbers (ref:
http://www.w3.org/TR/SVG11/types.html#BasicDataTypes).

The patch looks correct. Stylistically, I'd like to apply
without the lines that append whitespace; and the comments
are good to explain the patch, but I'll remove them when
applying. I'll also have a look for any other bugs in the
same code before committing ("where there are bugs there are
more bugs"): e.g. it looks as if the current code would
accept 1e3e4 as a valid number, where correct behaviour
would be to ignore the rest of the path data and indicate to
the user that the SVG file is in error.

Thanks for the patch.

Revision history for this message
Peter Moulder (pjrm) wrote :

The current code has quite a few problems with error
handling, so for the moment I'll just commit essentially the
submitter's patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.