File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 48
48
* 9/6/19
49
49
* - saner behaviour for vips_region_fetch() if the request is partly
50
50
* outside the image
51
+ * 22/2/21 f1ac
52
+ * - fix int overflow in vips_region_copy(), could cause crashes with
53
+ * very wide images
51
54
*/
52
55
53
56
/*
@@ -1048,12 +1051,13 @@ void
1048
1051
vips_region_copy ( VipsRegion * reg ,
1049
1052
VipsRegion * dest , const VipsRect * r , int x , int y )
1050
1053
{
1051
- int z ;
1052
- int len = VIPS_IMAGE_SIZEOF_PEL ( reg -> im ) * r -> width ;
1054
+ size_t len = VIPS_IMAGE_SIZEOF_PEL ( reg -> im ) * r -> width ;
1053
1055
VipsPel * p = VIPS_REGION_ADDR ( reg , r -> left , r -> top );
1054
1056
VipsPel * q = VIPS_REGION_ADDR ( dest , x , y );
1055
- int plsk = VIPS_REGION_LSKIP ( reg );
1056
- int qlsk = VIPS_REGION_LSKIP ( dest );
1057
+ size_t plsk = VIPS_REGION_LSKIP ( reg );
1058
+ size_t qlsk = VIPS_REGION_LSKIP ( dest );
1059
+
1060
+ int z ;
1057
1061
1058
1062
#ifdef DEBUG
1059
1063
/* Find the area we will write to in dest.
You can’t perform that action at this time.
0 commit comments