|
|
e53adb |
diff -up ImageMagick-6.7.8-9/magick/transform.c.splice-crash ImageMagick-6.7.8-9/magick/transform.c
|
|
|
e53adb |
--- ImageMagick-6.7.8-9/magick/transform.c.splice-crash 2012-06-20 15:03:21.000000000 +0200
|
|
|
e53adb |
+++ ImageMagick-6.7.8-9/magick/transform.c 2016-06-02 17:40:43.860641940 +0200
|
|
|
e53adb |
@@ -65,6 +65,7 @@
|
|
|
e53adb |
#include "magick/string_.h"
|
|
|
e53adb |
#include "magick/thread-private.h"
|
|
|
e53adb |
#include "magick/transform.h"
|
|
|
e53adb |
+#define MagickMin(x,y) (((x) < (y)) ? (x) : (y))
|
|
|
e53adb |
|
|
|
e53adb |
/*
|
|
|
e53adb |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
e53adb |
@@ -1646,6 +1647,7 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
splice_geometry;
|
|
|
e53adb |
|
|
|
e53adb |
ssize_t
|
|
|
e53adb |
+ columns,
|
|
|
e53adb |
y;
|
|
|
e53adb |
|
|
|
e53adb |
/*
|
|
|
e53adb |
@@ -1730,6 +1732,7 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
*/
|
|
|
e53adb |
status=MagickTrue;
|
|
|
e53adb |
progress=0;
|
|
|
e53adb |
+ columns=MagickMin(splice_geometry.x,(ssize_t) splice_image->columns);
|
|
|
e53adb |
image_view=AcquireVirtualCacheView(image,exception);
|
|
|
e53adb |
splice_view=AcquireAuthenticCacheView(splice_image,exception);
|
|
|
e53adb |
#if defined(MAGICKCORE_OPENMP_SUPPORT)
|
|
|
e53adb |
@@ -1753,7 +1756,8 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
|
|
|
e53adb |
if (status == MagickFalse)
|
|
|
e53adb |
continue;
|
|
|
e53adb |
- p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
|
|
|
e53adb |
+ p=GetCacheViewVirtualPixels(image_view,0,y,splice_image->columns,1,
|
|
|
e53adb |
+ exception);
|
|
|
e53adb |
q=QueueCacheViewAuthenticPixels(splice_view,0,y,splice_image->columns,1,
|
|
|
e53adb |
exception);
|
|
|
e53adb |
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
|
|
|
e53adb |
@@ -1763,7 +1767,7 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
}
|
|
|
e53adb |
indexes=GetCacheViewAuthenticIndexQueue(image_view);
|
|
|
e53adb |
splice_indexes=GetCacheViewAuthenticIndexQueue(splice_view);
|
|
|
e53adb |
- for (x=0; x < splice_geometry.x; x++)
|
|
|
e53adb |
+ for (x=0; x < columns; x++)
|
|
|
e53adb |
{
|
|
|
e53adb |
SetPixelRed(q,GetPixelRed(p));
|
|
|
e53adb |
SetPixelGreen(q,GetPixelGreen(p));
|
|
|
e53adb |
@@ -1833,10 +1837,10 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
|
|
|
e53adb |
if (status == MagickFalse)
|
|
|
e53adb |
continue;
|
|
|
e53adb |
- p=GetCacheViewVirtualPixels(image_view,0,y-(ssize_t) splice_geometry.height,
|
|
|
e53adb |
- image->columns,1,exception);
|
|
|
e53adb |
- if ((y < 0) || (y >= (ssize_t) splice_image->rows))
|
|
|
e53adb |
+ if ((y < 0) || (y >= (ssize_t)splice_image->rows))
|
|
|
e53adb |
continue;
|
|
|
e53adb |
+ p=GetCacheViewVirtualPixels(image_view,0,y-(ssize_t) splice_geometry.height,
|
|
|
e53adb |
+ splice_image->columns,1,exception);
|
|
|
e53adb |
q=QueueCacheViewAuthenticPixels(splice_view,0,y,splice_image->columns,1,
|
|
|
e53adb |
exception);
|
|
|
e53adb |
if ((p == (const PixelPacket *) NULL) || (q == (PixelPacket *) NULL))
|
|
|
e53adb |
@@ -1846,7 +1850,7 @@ MagickExport Image *SpliceImage(const Im
|
|
|
e53adb |
}
|
|
|
e53adb |
indexes=GetCacheViewAuthenticIndexQueue(image_view);
|
|
|
e53adb |
splice_indexes=GetCacheViewAuthenticIndexQueue(splice_view);
|
|
|
e53adb |
- for (x=0; x < splice_geometry.x; x++)
|
|
|
e53adb |
+ for (x=0; x < columns; x++)
|
|
|
e53adb |
{
|
|
|
e53adb |
SetPixelRed(q,GetPixelRed(p));
|
|
|
e53adb |
SetPixelGreen(q,GetPixelGreen(p));
|