[gegl] buffer: gegl_buffer_Get re-add zeroing of temporary allocation



commit e13e93acfea7e46e9b8360c8b2ff92f3e354e377
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Oct 17 16:34:34 2015 +0200

    buffer: gegl_buffer_Get re-add zeroing of temporary allocation
    
    Reverting part of the preceding optimization series.

 gegl/buffer/gegl-buffer-access.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 00cfc18..4d7477a 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1458,9 +1458,6 @@ _gegl_buffer_get_unlocked (GeglBuffer          *buffer,
       sample_rect.width  = factor * (x2 - x1);
       sample_rect.height = factor * (y2 - y1);
 
-      if (rowstride == GEGL_AUTO_ROWSTRIDE)
-        rowstride = rect->width * bpp;
-
       if (scale == 1.0)
         {
           gegl_buffer_iterate_read_dispatch (buffer, &sample_rect, (guchar*)dest_buf + offset, rowstride,
@@ -1468,7 +1465,10 @@ _gegl_buffer_get_unlocked (GeglBuffer          *buffer,
           return;
         }
 
-      sample_buf = g_malloc (buf_height * buf_width * bpp);
+      if (rowstride == GEGL_AUTO_ROWSTRIDE)
+        rowstride = rect->width * bpp;
+
+      sample_buf = g_malloc0 (buf_height * buf_width * bpp);
       gegl_buffer_iterate_read_dispatch (buffer, &sample_rect, (guchar*)sample_buf + offset, buf_width * bpp,
                                          format, level, repeat_mode);
 


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