zero radius arcs with librsvg-2.2.4




I have the following simple example.

<?xml version="1.0" standalone="yes"?>
<svg width="3100" height="2200">
<g style="stroke-width: 4pt;">
<rect x="0" y="0" width="310" height="220" style="fill:pink;"/>
</g>
</svg>

This works on linux, but only by luck.  On HP-UX it goes into infinite loops.  Below is a trace from gdb.


#0  rsvg_path_arc (ctx=0x7f7e2e48, rx=0, ry=0, x_axis_rotation=0, large_arc_flag=0, sweep_flag=1, x=310, y=1)
    at rsvg-path.c:153
#1  0x7f14cde0 in rsvg_parse_path_do_cmd (ctx=0x7f7e2e48, final=0) at rsvg-path.c:364
#2  0x7f14d3d4 in rsvg_parse_path_data (ctx=0x7f7e2e48,
    data="" "M 0 1 H 310 A0 0 0 0 1 310 1 V 221 A0 0 0 0 1 310 221 H 0 A0 0 0 0 1 0 221 V 1 A0 0 0 0 1 0 1") at rsvg-path.c:497
#3  0x7f14d644 in rsvg_parse_path (
    path_str=0x41a112a0 "M 0 1 H 310 A0 0 0 0 1 310 1 V 221 A0 0 0 0 1 310 221 H 0 A0 0 0 0 1 0 221 V 1 A0 0 0 0 1 0 1") at rsvg-path.c:549
#4  0x7f14f7b8 in rsvg_render_path (ctx=0x40006af8,
    d=0x41a112a0 "M 0 1 H 310 A0 0 0 0 1 310 1 V 221 A0 0 0 0 1 310 221 H 0 A0 0 0 0 1 0 221 V 1 A0 0 0 0 1 0 1") at rsvg-shapes.c:256
#5  0x7f151b6c in rsvg_start_rect (ctx=0x40006af8, atts=0x41a10d68) at rsvg-shapes.c:574
#6  0x7f15cbb0 in rsvg_start_element (data="" name=0x4000ac00 "rect", atts=0x41a10d68) at rsvg.c:830
#7  0x7f240e10 in xmlParseStartTag (ctxt=0x4000a950) at parser.c:6747
#8  0x7f244d18 in xmlParseTryOrFinish (ctxt=0x4000a950, terminate=0) at parser.c:8574
#9  0x7f2458a8 in xmlParseChunk (ctxt=0x4000a950, chunk=0x7ff40000 "", size=0, terminate=0) at parser.c:9011
#10 0x7f15d478 in rsvg_handle_write_impl (handle=0x40006af8,
    buf=0x7f7e0908 "<?xml version=\"1.0\" standalone=\"yes\"?>\n<svg width=\"3100\" height=\"2200\">\n<g style=\"stroke-width: 4pt;\">\n\n<rect x=\"0\" y=\"0\" width=\"310\" height=\"220\" style=\"fill:pink;\"/>\n\n</g>\n</svg>\n", count=181, error=0x0) at rsvg.c:998
#11 0x7f15dca0 in rsvg_handle_write (handle=0x40006af8,
    buf=0x7f7e0908 "<?xml version=\"1.0\" standalone=\"yes\"?>\n<svg width=\"3100\" height=\"2200\">\n<g style=\"stroke-width: 4pt;\">\n\n<rect x=\"0\" y=\"0\" width=\"310\" height=\"220\" style=\"fill:pink;\"/>\n\n</g>\n</svg>\n", count=181, error=0x0) at rsvg.c:1189
#12 0x7f14ddd4 in rsvg_pixbuf_from_file_with_size_data_ex (handle=0x40006af8,
    file_name=0x7f7e0014 "/home/ralexand/rect.svg", data="" error=0x0) at rsvg-file-util.c:134
#13 0x7f14df3c in rsvg_pixbuf_from_file_with_size_data (file_name=0x7f7e0014 "/home/ralexand/rect.svg",
    data="" error=0x0) at rsvg-file-util.c:188
#14 0x7f14e6cc in rsvg_pixbuf_from_file_at_zoom (file_name=0x7f7e0014 "/home/ralexand/rect.svg", x_zoom=1,
    y_zoom=1, error=0x0) at rsvg-file-util.c:405
#15 0x00003c88 in main (argc=3, argv=0x7f7e04ec) at test-rsvg.c:100


As you can see the path has an arc of zero radius.  As rsvg_path_arc divides quanties from rx and ry NaNs start appearing
very where.  Clearly there is a bug here.  I'm willing to patch this problem but I would like to know how you want to deal
with his.

PS: Is xlink support in the offering?

#4  0x7f14f7b8 in rsvg_render_path (ctx=0x40006af8,
    d=0x41a112a0 "M 0 1 H 310 A0 0 0 0 1 310 1 V 221 A0 0 0 0 1 310 221 H 0 A0 0 0 0 1 0 221 V 1 A0 0 0 0 1 0 1") at rsvg-shapes.c:256


Many thanks

Ross

---------------------------------------------------------------------------------
Ross Alexander                           "We demand clearly defined
MIS - NEC Europe Limited            boundaries of uncertainty and
Work ph: +44 20 8752 3394         doubt."


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]