[librsvg] Handle::get_pixbuf_sub(): Use the same code as elsewhere to get the dimensions



commit 8662e6c891c95e4fb6faef7a2bca76c0be91d956
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Dec 28 11:21:04 2018 -0600

    Handle::get_pixbuf_sub(): Use the same code as elsewhere to get the dimensions

 rsvg_internals/src/handle.rs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/src/handle.rs b/rsvg_internals/src/handle.rs
index dc9e54ff..4fabdeb2 100644
--- a/rsvg_internals/src/handle.rs
+++ b/rsvg_internals/src/handle.rs
@@ -440,11 +440,11 @@ impl Handle {
         handle: *mut RsvgHandle,
         id: Option<&str>,
     ) -> Result<Pixbuf, RenderingError> {
-        let mut dimensions = unsafe { mem::zeroed() };
-
-        unsafe {
+        let dimensions = unsafe {
+            let mut dimensions = mem::zeroed();
             rsvg_handle_get_dimensions(handle, &mut dimensions);
-        }
+            dimensions
+        };
 
         if dimensions.width == 0 || dimensions.height == 0 {
             return Err(RenderingError::SvgHasNoSize);


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