Repository: linebender/resvg (language: rust)

Issue:
Panic on rendering certain files with raqote
The attached file causes a panic when rendering with the raqote backend. It renders fine with cairo backend. The file is zipped so that github would accept the upload. 

Backtrace:
```
> env RUST_BACKTRACE=1 /home/shnatsel/Code/resvg/target/release/rendersvg --backend=raqote status/48/night-light-symbolic.svg ~/out.png
thread 'main' panicked at 'index 2313 out of range for slice of length 2304', src/libcore/slice/mod.rs:2560:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:59
             at src/libstd/panicking.rs:197
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:211
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:474
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:381
   6: rust_begin_unwind
             at src/libstd/panicking.rs:308
   7: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
   8: core::slice::slice_index_len_fail
             at src/libcore/slice/mod.rs:2560
   9: <raqote::blitter::ImagePadAlphaShader as raqote::blitter::Shader>::shade_span
  10: <raqote::blitter::ShaderBlendBlitter as raqote::blitter::Blitter>::blit_span
  11: raqote::draw_target::DrawTarget::composite
  12: raqote::draw_target::DrawTarget::fill
  13: raqote::draw_target::DrawTarget::draw_image_at
  14: resvg::backend_raqote::filter::copy_image
  15: <resvg::backend_raqote::filter::RaqoteFilter as resvg::backend_utils::filter::Filter<raqote::draw_target::DrawTarget>>::get_input
  16: resvg::backend_raqote::filter::apply
  17: resvg::backend_raqote::render_node
  18: resvg::backend_raqote::render_group
  19: resvg::backend_raqote::render_node
  20: resvg::backend_raqote::render_node_to_canvas
  21: resvg::backend_raqote::render_to_canvas
  22: resvg::backend_raqote::render_to_image
  23: <resvg::backend_raqote::Backend as resvg::Render>::render_to_image
  24: rendersvg::main
  25: std::rt::lang_start::{{closure}}
  26: std::panicking::try::do_call
             at src/libstd/rt.rs:49
             at src/libstd/panicking.rs:293
  27: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:87
  28: std::rt::lang_start_internal
             at src/libstd/panicking.rs:272
             at src/libstd/panic.rs:388
             at src/libstd/rt.rs:48
  29: main
  30: __libc_start_main
  31: _start
```
[night-light-symbolic.svg.zip](https://github.com/RazrFalcon/resvg/files/3311845/night-light-symbolic.svg.zip)


Discussion / hints:
I'm using raqote 0.5.3 and resvg from it at commit ec197b40db61256dedd9372d986a9c21c3cf2694
Here's the Cargo.lock: [Cargo.lock.zip](https://github.com/RazrFalcon/resvg/files/3311851/Cargo.lock.zip)



cc @jrmuizel since the backtrace points to raqote itself

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index 51b3a9301..ea651e30b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -549,7 +549,7 @@ dependencies = [
 
 [[package]]
 name = "raqote"
-version = "0.5.3"
+version = "0.5.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "euclid 0.19.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -588,7 +588,7 @@ dependencies = [
  "gdk-pixbuf 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "raqote 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "raqote 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "resvg-qt 0.7.0",
  "rgb 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "usvg 0.7.0",
@@ -858,7 +858,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427"
 "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
 "checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"
-"checksum raqote 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ed2f21df4a18a45dfc4c5d71b18b23618c63db12e3cfc21ad2a3318049ff83d"
+"checksum raqote 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ff42701d43ddf150660ee0a108fb09bb4355be1e0405d9404eaf824fa3e5975f"
 "checksum rctree 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "193d11923532b462b7231e2d7fb785a9c0d580b03c0eccac460a1e9ee0e87fda"
 "checksum redox_syscall 0.1.54 (registry+https://github.com/rust-lang/crates.io-index)" = "12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252"
 "checksum rgb 0.8.13 (registry+https://github.com/rust-lang/crates.io-index)" = "4f089652ca87f5a82a62935ec6172a534066c7b97be003cc8f702ee9a7a59c92"
diff --git a/Cargo.toml b/Cargo.toml
index c163f648d..638e76958 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,7 +36,7 @@ gdk-pixbuf = { version = "0.6", optional = true }
 resvg-qt = { path = "resvg-qt", version = "0.7", optional = true }
 
 # raqote backend
-raqote = { version = "0.5.3", default-features = false, optional = true }
+raqote = { version = "0.5.5", default-features = false, optional = true }
 
 [dependencies.image]
 version = "0.21"


Test patch:
diff --git a/testing-tools/regression/allow-raqote.txt b/testing-tools/regression/allow-raqote.txt
index e69de29bb..4e992417f 100644
--- a/testing-tools/regression/allow-raqote.txt
+++ b/testing-tools/regression/allow-raqote.txt
@@ -0,0 +1,57 @@
+a-clip-path-001.svg
+a-clip-rule-001.svg
+a-display-004.svg
+a-display-008.svg
+a-overflow-002.svg
+a-systemLanguage-008.svg
+a-visibility-007.svg
+e-clipPath-001.svg
+e-clipPath-002.svg
+e-clipPath-003.svg
+e-clipPath-004.svg
+e-clipPath-005.svg
+e-clipPath-006.svg
+e-clipPath-007.svg
+e-clipPath-008.svg
+e-clipPath-009.svg
+e-clipPath-010.svg
+e-clipPath-011.svg
+e-clipPath-012.svg
+e-clipPath-013.svg
+e-clipPath-014.svg
+e-clipPath-015.svg
+e-clipPath-016.svg
+e-clipPath-017.svg
+e-clipPath-018.svg
+e-clipPath-019.svg
+e-clipPath-020.svg
+e-clipPath-021.svg
+e-clipPath-029.svg
+e-clipPath-030.svg
+e-clipPath-031.svg
+e-clipPath-034.svg
+e-clipPath-035.svg
+e-clipPath-036.svg
+e-clipPath-037.svg
+e-clipPath-038.svg
+e-clipPath-039.svg
+e-clipPath-040.svg
+e-clipPath-041.svg
+e-clipPath-042.svg
+e-clipPath-044.svg
+e-marker-002.svg
+e-marker-003.svg
+e-marker-004.svg
+e-marker-008.svg
+e-marker-009.svg
+e-marker-036.svg
+e-svg-024.svg
+e-svg-025.svg
+e-svg-026.svg
+e-svg-027.svg
+e-svg-030.svg
+e-symbol-004.svg
+e-symbol-005.svg
+e-symbol-006.svg
+e-symbol-008.svg
+e-symbol-009.svg