summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/pixops
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2015-09-22 22:44:51 +0200
committerMatthias Clasen <mclasen@redhat.com>2015-09-25 06:49:17 -0400
commite9a5704edaa9aee9498f1fbf6e1b70fcce2e55aa (patch)
tree8df6fa95460405cac043366496f1a1d0dd9876dd /gdk-pixbuf/pixops
parent10b0b7e57e47399bf07a3e23998b868170278ad9 (diff)
downloadgdk-pixbuf-e9a5704edaa9aee9498f1fbf6e1b70fcce2e55aa.tar.gz
pixops: Don't overflow variables when shifting them
If we shift by 16 bits we need to be sure those 16 bits actually exist. They do now.
Diffstat (limited to 'gdk-pixbuf/pixops')
-rw-r--r--gdk-pixbuf/pixops/pixops.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c
index 4cdb5df54..b0abecd1b 100644
--- a/gdk-pixbuf/pixops/pixops.c
+++ b/gdk-pixbuf/pixops/pixops.c
@@ -264,11 +264,11 @@ pixops_scale_nearest (guchar *dest_buf,
double scale_x,
double scale_y)
{
- int i;
- int x;
- int x_step = (1 << SCALE_SHIFT) / scale_x;
- int y_step = (1 << SCALE_SHIFT) / scale_y;
- int xmax, xstart, xstop, x_pos, y_pos;
+ gint64 i;
+ gint64 x;
+ gint64 x_step = (1 << SCALE_SHIFT) / scale_x;
+ gint64 y_step = (1 << SCALE_SHIFT) / scale_y;
+ gint64 xmax, xstart, xstop, x_pos, y_pos;
const guchar *p;
#define INNER_LOOP(SRC_CHANNELS,DEST_CHANNELS,ASSIGN_PIXEL) \