[librsvg/librsvg-2.44] Add a sanity check to PixelRectangle
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/librsvg-2.44] Add a sanity check to PixelRectangle
- Date: Tue, 18 Sep 2018 21:18:24 +0000 (UTC)
commit 333cf7733e2a70049419ca594ac340eaca1341ba
Author: Ivan Molodetskikh <yalterz gmail com>
Date: Sat Sep 15 12:41:01 2018 +0300
Add a sanity check to PixelRectangle
rsvg_internals/src/surface_utils/iterators.rs | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/rsvg_internals/src/surface_utils/iterators.rs b/rsvg_internals/src/surface_utils/iterators.rs
index ea74b9ed..477006ca 100644
--- a/rsvg_internals/src/surface_utils/iterators.rs
+++ b/rsvg_internals/src/surface_utils/iterators.rs
@@ -69,6 +69,12 @@ impl<'a> PixelRectangle<'a> {
assert!(bounds.y1 >= bounds.y0);
assert!(bounds.y1 <= surface.height());
+ // Non-None EdgeMode values need at least one pixel available.
+ if edge_mode != EdgeMode::None {
+ assert!(bounds.x1 > bounds.x0);
+ assert!(bounds.y1 > bounds.y0);
+ }
+
assert!(rectangle.x1 >= rectangle.x0);
assert!(rectangle.y1 >= rectangle.y0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]