[gegl] buffer: in gegl-algorithms.c, fix potential overflow in _gegl_trunc_u32()



commit 515d6b92b06a58fbde6e880d3fd1f9049d4c425b
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 6 08:20:01 2019 -0500

    buffer: in gegl-algorithms.c, fix potential overflow in _gegl_trunc_u32()

 gegl/buffer/gegl-algorithms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gegl/buffer/gegl-algorithms.c b/gegl/buffer/gegl-algorithms.c
index d2905a77c..65efb2149 100644
--- a/gegl/buffer/gegl-algorithms.c
+++ b/gegl/buffer/gegl-algorithms.c
@@ -1354,8 +1354,8 @@ gegl_resample_nearest (guchar              *dst,
 
 static inline guint32 _gegl_trunc_u32(guint64 value)
 {
-  if ((guint64) value > ((1l<<32)-1))
-   return (1l<<32)-1;
+  if ((guint64) value > G_MAXUINT32)
+    return G_MAXUINT32;
   return value;
 }
 


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