[librsvg] with_discrete_layer(): Propagate errors from cairo::ImageSurface::create()
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] with_discrete_layer(): Propagate errors from cairo::ImageSurface::create()
- Date: Mon, 24 Sep 2018 00:16:59 +0000 (UTC)
commit 1b1fba9d3aabd24ce905e87d16b99283410fe58c
Author: Federico Mena Quintero <federico gnome org>
Date: Sun Sep 23 18:56:31 2018 -0500
with_discrete_layer(): Propagate errors from cairo::ImageSurface::create()
This is the second part of #345.
rsvg_internals/src/drawing_ctx.rs | 2 +-
tests/fixtures/render-crash/345-too-large-size.svg | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/drawing_ctx.rs b/rsvg_internals/src/drawing_ctx.rs
index c34b2490..01c21b17 100644
--- a/rsvg_internals/src/drawing_ctx.rs
+++ b/rsvg_internals/src/drawing_ctx.rs
@@ -405,7 +405,7 @@ impl<'a> DrawingCtx<'a> {
cairo::Format::ARgb32,
self.rect.width as i32,
self.rect.height as i32,
- ).unwrap();
+ )?;
if filter.is_some() {
self.surfaces_stack.push(surface.clone());
diff --git a/tests/fixtures/render-crash/345-too-large-size.svg
b/tests/fixtures/render-crash/345-too-large-size.svg
new file mode 100644
index 00000000..bc5cfde2
--- /dev/null
+++ b/tests/fixtures/render-crash/345-too-large-size.svg
@@ -0,0 +1,3 @@
+<svg>
+ <path d="M0,0 L1,0 L100000,100000" style="opacity:0"/>
+</svg>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]