summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-08-22 17:57:23 +0200
committerBenjamin Otte <otte@redhat.com>2015-08-22 17:57:23 +0200
commit3df91dc6c6f8d1421e9c8756959280de792af77a (patch)
tree0ebee4abe497b571022a340e4201b57a70b56ed8
parent2908f1299b38b28115e35ab16c48897433daaa29 (diff)
downloadgdk-pixbuf-3df91dc6c6f8d1421e9c8756959280de792af77a.tar.gz
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
-rw-r--r--gdk-pixbuf/pixops/pixops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c
index 7f2cbff02..b7951c721 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;