replace memcpy() in d180 with a loop

thanks alantudyk

see https://github.com/libvips/libvips/issues/3149#issuecomment-1309405404
This commit is contained in:
John Cupitt 2022-11-10 04:45:50 +00:00
parent b8a2d26ad9
commit 144834a6aa
1 changed files with 6 additions and 2 deletions

View File

@ -28,6 +28,8 @@
* - rewrite as a class
* 7/3/17
* - added 90/180/270 convenience functions
* 10/11/22 alantudyk
* - swapped memcpy() in d180 for a loop
*/
/*
@ -170,7 +172,7 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b,
int to = r->top;
int bo = VIPS_RECT_BOTTOM(r);
int x, y;
int x, y, i;
/* Pixel geometry.
*/
@ -207,7 +209,9 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b,
/* Blap across!
*/
for( x = le; x < ri; x++ ) {
memcpy( q, p, ps );
for( i = 0; i < ps; i++ )
q[i] = p[i];
q += ps;
p -= ps;
}