[gdk-pixbuf] Avoid integer overflow in gdk_pixbuf_rotate_simple



commit 4f68cb78a5277f169b9531e6998c00c7976594e4
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 24 15:29:36 2015 -0400

    Avoid integer overflow in gdk_pixbuf_rotate_simple
    
    Same as before: don't do ptr = base + y * rowstride if y and
    rowstride are integers.

 gdk-pixbuf/gdk-pixbuf-scale.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-scale.c b/gdk-pixbuf/gdk-pixbuf-scale.c
index 4288c65..475126a 100644
--- a/gdk-pixbuf/gdk-pixbuf-scale.c
+++ b/gdk-pixbuf/gdk-pixbuf-scale.c
@@ -396,7 +396,7 @@ gdk_pixbuf_composite_color_simple (const GdkPixbuf *src,
   return dest;
 }
 
-#define OFFSET(pb, x, y) ((x) * (pb)->n_channels + (y) * (pb)->rowstride)
+#define OFFSET(pb, x, y) ((x) * (pb)->n_channels + (gsize)(y) * (pb)->rowstride)
 
 /**
  * gdk_pixbuf_rotate_simple:


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