[gegl] pixelize: fix portability of integer overflow casting



commit e08b3e0376c0e44dbe1bd68d34615d22122e5cb1
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Jun 19 17:32:46 2018 +0200

    pixelize: fix portability of integer overflow casting
    
    Use gint64 instead of long, since on windows long still means 32bit,
    ref comment from massimo in issue #78

 operations/common/pixelize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/operations/common/pixelize.c b/operations/common/pixelize.c
index a113124d1..0d6f331be 100644
--- a/operations/common/pixelize.c
+++ b/operations/common/pixelize.c
@@ -569,7 +569,7 @@ process (GeglOperation       *operation,
     if (cl_process (operation, input, output, roi))
       return TRUE;
 
-  if ((long)o->size_x * (long)o->size_y < SQR (ALLOC_THRESHOLD_SIZE))
+  if ((gint64)o->size_x * (gint64)o->size_y < SQR (ALLOC_THRESHOLD_SIZE))
     {
       gfloat  background_color[4];
       gfloat *input_buf  = g_new (gfloat,


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