mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-20 02:10:12 +00:00
Avoid an FPE for ludicrous scale values
...just bail out early.
This commit is contained in:
parent
b3e06e8302
commit
675ead1d82
@ -1251,11 +1251,20 @@ pixops_process (guchar *dest_buf,
|
|||||||
int i, j;
|
int i, j;
|
||||||
int x, y; /* X and Y position in source (fixed_point) */
|
int x, y; /* X and Y position in source (fixed_point) */
|
||||||
|
|
||||||
guchar **line_bufs = g_new (guchar *, filter->y.n);
|
guchar **line_bufs;
|
||||||
int *filter_weights = make_filter_table (filter);
|
int *filter_weights;
|
||||||
|
|
||||||
int x_step = (1 << SCALE_SHIFT) / scale_x; /* X step in source (fixed point) */
|
int x_step;
|
||||||
int y_step = (1 << SCALE_SHIFT) / scale_y; /* Y step in source (fixed point) */
|
int y_step;
|
||||||
|
|
||||||
|
x_step = (1 << SCALE_SHIFT) / scale_x; /* X step in source (fixed point) */
|
||||||
|
y_step = (1 << SCALE_SHIFT) / scale_y; /* Y step in source (fixed point) */
|
||||||
|
|
||||||
|
if (x_step == 0 || y_step == 0)
|
||||||
|
return; /* overflow, bail out */
|
||||||
|
|
||||||
|
line_bufs = g_new (guchar *, filter->y.n);
|
||||||
|
filter_weights = make_filter_table (filter);
|
||||||
|
|
||||||
int check_shift = check_size ? get_check_shift (check_size) : 0;
|
int check_shift = check_size ? get_check_shift (check_size) : 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user