Morphology needs positive radii even after the transformation
authorFederico Mena Quintero <federico@gnome.org>
Sat, 29 Dec 2018 18:32:08 +0000 (12:32 -0600)
committerBoyuan Yang <byang@debian.org>
Thu, 25 Apr 2019 19:55:18 +0000 (20:55 +0100)
This is the same pattern as in gaussian_blur.rs; the paffine
transformation can leave us with negative radii, so take their
absolute value after the transformation.

This fixes assertion error (crashing) when nagative r takes place.

Forwarded: https://gitlab.gnome.org/GNOME/librsvg/issues/395
Applied-Upstream: https://gitlab.gnome.org/GNOME/librsvg/commit/4ef7f198fceb8fb4a544f4768174af5b11fc9bcc
Bug-Debian: https://bugs.debian.org/927886
Signed-off-by: Boyuan Yang <byang@debian.org>
Gbp-Pq: Name keep-positive-radii.patch

rsvg_internals/src/filters/morphology.rs

index 60fbcef03abd7ceff1fe60ac818c154011117c52..7de1a0dcd9af92f0a06f0a75e419f85b59277fad 100644 (file)
@@ -95,6 +95,10 @@ impl Filter for Morphology {
         let (rx, ry) = self.radius.get();
         let (rx, ry) = ctx.paffine().transform_distance(rx, ry);
 
+        // The radii can become negative here due to the transform.
+        let rx = rx.abs();
+        let ry = ry.abs();
+
         let operator = self.operator.get();
 
         let mut output_surface = ImageSurface::create(