After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685906 - Wrong marker angle when control point and point of a curve are at the same position
Wrong marker angle when control point and point of a curve are at the same po...
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
unspecified
Other Linux
: High normal
: ---
Assigned To: Federico Mena Quintero
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2012-10-10 18:31 UTC by Emmanuel Pacaud
Modified: 2016-01-05 19:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample file (10.36 KB, image/svg+xml)
2012-10-10 18:32 UTC, Emmanuel Pacaud
  Details
Reference rendering (2.83 KB, image/png)
2012-10-10 18:32 UTC, Emmanuel Pacaud
  Details
librsvg output (2.84 KB, image/png)
2012-10-10 18:34 UTC, Emmanuel Pacaud
  Details
NULL pointer crash! (1.12 KB, patch)
2015-12-21 13:15 UTC, mik@gmx.org
none Details | Review

Description Emmanuel Pacaud 2012-10-10 18:31:48 UTC
For example, with the following path:

M 10,10 C 20,20 50,50 50,50

An end marker will have a wrong angle.
Comment 1 Emmanuel Pacaud 2012-10-10 18:32:16 UTC
Created attachment 226190 [details]
Sample file
Comment 2 Emmanuel Pacaud 2012-10-10 18:32:54 UTC
Created attachment 226191 [details]
Reference rendering
Comment 3 Emmanuel Pacaud 2012-10-10 18:34:28 UTC
Created attachment 226192 [details]
librsvg output
Comment 4 Emmanuel Pacaud 2012-10-11 06:49:15 UTC
Here's what I did in order to fix this issue in lasem, which has more or less the same code as librsvg:

http://git.gnome.org/browse/lasem/commit/?id=adc0ccccf820afd513f7e6929dd0fed6cab645d3
Comment 5 Federico Mena Quintero 2015-11-03 21:37:46 UTC
This renders better now, after all the refactoring and fixes from bug #677068.  It still doesn't render the top-right arrow, though.  Need to take a closer look at lasem!
Comment 6 Federico Mena Quintero 2015-12-08 02:21:12 UTC
OK, this is fixed now!

Take a look at commit 0cfdd27ecb5023b65865d6458d9a810f48f08eb2 - this is a rewrite of the marker-drawing code.  I think it's more robust than lasem's for multiple subsequent zero-length segments :)  Feel free to use it there.

Librsvg not only screwed up the angles; it also got NaNs in the middle vertex, which I think got Cairo into an error state so that no subsequent markers got drawn within that path.  This is fixed now.
Comment 7 mik@gmx.org 2015-12-21 13:15:29 UTC
Created attachment 317732 [details] [review]
NULL pointer crash!

New marker bug in recent commit!

https://git.gnome.org/browse/librsvg/commit/?id=7621ae4f61901c349af7cfe5ae3790b417227bf6

This fix breaks "make check" with the following SVG file:

https://git.gnome.org/browse/librsvg/tree/tests/fixtures/reftests/bugs/476507.svg?id=0cfdd27ecb5023b65865d6458d9a810f48f08eb2

Markers with NULL pointer are not omitted. In consequence memory violations occure and librsvg crashes.
Comment 8 Federico Mena Quintero 2016-01-05 19:53:52 UTC
Good catch!  I've pushed a fix that puts the test inside rsvg_marker_render() so the caller can avoid having a test at each call.