mirror of https://github.com/GNOME/gimp.git
don't read beyond the src buffer. Fixes bug #164963.
2005-01-23 Sven Neumann <sven@gimp.org> * plug-ins/common/edge.c: don't read beyond the src buffer. Fixes bug #164963.
This commit is contained in:
parent
981d9ed8a5
commit
53bbce378f
|
@ -1,3 +1,8 @@
|
|||
2005-01-23 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/edge.c: don't read beyond the src buffer. Fixes
|
||||
bug #164963.
|
||||
|
||||
2005-01-23 Maurits Rijk <m.rijk@chello.nl>
|
||||
|
||||
* plug-ins/imagemap/imap_toolbar.[ch]
|
||||
|
|
|
@ -824,7 +824,9 @@ edge_preview_update (GimpPreview *preview)
|
|||
{
|
||||
guchar kernel[9];
|
||||
|
||||
#define SRC(X,Y) src[bytes * ( CLAMP((X),0,width) + width * CLAMP((Y),0,height) )+chan]
|
||||
#define SRC(X,Y) src[bytes * (CLAMP((X), 0, width-1) + \
|
||||
width * CLAMP((Y), 0, height-1)) + chan]
|
||||
|
||||
kernel[0] = SRC (x - 1, y - 1);
|
||||
kernel[1] = SRC (x - 1, y );
|
||||
kernel[2] = SRC (x - 1, y + 1);
|
||||
|
@ -834,6 +836,7 @@ edge_preview_update (GimpPreview *preview)
|
|||
kernel[6] = SRC (x + 1, y - 1);
|
||||
kernel[7] = SRC (x + 1, y );
|
||||
kernel[8] = SRC (x + 1, y + 1);
|
||||
|
||||
#undef SRC
|
||||
dest[chan] = edge_detect (kernel);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue