[gdk-pixbuf] pixops: Chane variable type



commit 3df91dc6c6f8d1421e9c8756959280de792af77a
Author: Benjamin Otte <otte redhat com>
Date:   Sat Aug 22 17:57:23 2015 +0200

    pixops: Chane variable type
    
    n_weights is used to do overflow checks. So by reducing the size to 32
    bits signed we overflow earlier. This is necessary because further down
    the code lots of code uses int variables to iterate over this variable
    and we don't want those to overflow.
    
    The correct fix would be to make all those variables gsize too, but
    that's way more invasive and requires different checks in different
    places so I'm not gonna do that now.
    And as long as scale factors are not expected to reach G_MAXINT it's not
    really necessary to do this change anyway.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753908

 gdk-pixbuf/pixops/pixops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c
index 7f2cbff..b7951c7 100644
--- a/gdk-pixbuf/pixops/pixops.c
+++ b/gdk-pixbuf/pixops/pixops.c
@@ -1272,7 +1272,7 @@ make_filter_table (PixopsFilter *filter)
   int i_offset, j_offset;
   int n_x = filter->x.n;
   int n_y = filter->y.n;
-  gsize n_weights;
+  int n_weights;
   int *weights;
 
   n_weights = SUBSAMPLE * SUBSAMPLE * n_x;


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