| From 3df91dc6c6f8d1421e9c8756959280de792af77a Mon Sep 17 00:00:00 2001 |
| From: Benjamin Otte <otte@redhat.com> |
| Date: Sat, 22 Aug 2015 17:57:23 +0200 |
| Subject: [PATCH] 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 file changed, 1 insertion(+), 1 deletion(-) |
| |
| 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; |
| -- |
| 2.5.1 |
| |