mirror of https://github.com/GNOME/gimp.git
don't call gdk_draw_pixbuf() with a zero width. Fixes bug #349483.
2007-05-09 Sven Neumann <sven@gimp.org> * app/display/gimpdisplayshell-preview.c (gimp_display_shell_draw_tri_row) (gimp_display_shell_draw_tri_row_mask): don't call gdk_draw_pixbuf() with a zero width. Fixes bug #349483. svn path=/trunk/; revision=22458
This commit is contained in:
parent
9570934d39
commit
38ffb13f5f
|
@ -1,3 +1,10 @@
|
|||
2007-05-09 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/display/gimpdisplayshell-preview.c
|
||||
(gimp_display_shell_draw_tri_row)
|
||||
(gimp_display_shell_draw_tri_row_mask): don't call gdk_draw_pixbuf()
|
||||
with a zero width. Fixes bug #349483.
|
||||
|
||||
2007-05-08 Raphaël Quinet <raphael@gimp.org>
|
||||
|
||||
* plug-ins/metadata/xmp-encode.c (gen_property): quick workaround
|
||||
|
|
|
@ -507,21 +507,30 @@ gimp_display_shell_draw_tri_row (GimpDrawable *texture,
|
|||
x1 = 0;
|
||||
}
|
||||
else if (x1 > gdk_pixbuf_get_width (row))
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (x2 < 0)
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (x2 > gdk_pixbuf_get_width (row))
|
||||
x2 = gdk_pixbuf_get_width (row);
|
||||
{
|
||||
x2 = gdk_pixbuf_get_width (row);
|
||||
}
|
||||
|
||||
dx = x2 - x1;
|
||||
|
||||
if (! dx)
|
||||
return;
|
||||
|
||||
switch (gimp_drawable_type (texture))
|
||||
{
|
||||
case GIMP_INDEXED_IMAGE:
|
||||
cmap = gimp_drawable_get_colormap (texture);
|
||||
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
|
||||
|
@ -539,7 +548,7 @@ gimp_display_shell_draw_tri_row (GimpDrawable *texture,
|
|||
case GIMP_INDEXEDA_IMAGE:
|
||||
cmap = gimp_drawable_get_colormap (texture);
|
||||
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
|
||||
|
@ -556,7 +565,7 @@ gimp_display_shell_draw_tri_row (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_GRAY_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
|
||||
|
@ -570,7 +579,7 @@ gimp_display_shell_draw_tri_row (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_GRAYA_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
|
||||
|
@ -586,7 +595,7 @@ gimp_display_shell_draw_tri_row (GimpDrawable *texture,
|
|||
|
||||
case GIMP_RGB_IMAGE:
|
||||
case GIMP_RGBA_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pptr);
|
||||
|
||||
|
@ -669,23 +678,33 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
x1 = 0;
|
||||
}
|
||||
else if (x1 > gdk_pixbuf_get_width (row))
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (x2 < 0)
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (x2 > gdk_pixbuf_get_width (row))
|
||||
x2 = gdk_pixbuf_get_width (row);
|
||||
{
|
||||
x2 = gdk_pixbuf_get_width (row);
|
||||
}
|
||||
|
||||
dx = x2 - x1;
|
||||
|
||||
if (! dx)
|
||||
return;
|
||||
|
||||
mu = u + mask_offx;
|
||||
mv = v + mask_offy;
|
||||
dx = x2 - x1;
|
||||
|
||||
switch (gimp_drawable_type (texture))
|
||||
{
|
||||
case GIMP_INDEXED_IMAGE:
|
||||
cmap = gimp_drawable_get_colormap (texture);
|
||||
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, pptr + alpha);
|
||||
|
@ -707,7 +726,7 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
case GIMP_INDEXEDA_IMAGE:
|
||||
cmap = gimp_drawable_get_colormap (texture);
|
||||
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
|
||||
|
@ -727,7 +746,7 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_GRAY_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, pptr + alpha);
|
||||
|
@ -745,7 +764,7 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_GRAYA_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pixel);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
|
||||
|
@ -763,7 +782,7 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_RGB_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pptr);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, pptr + alpha);
|
||||
|
@ -777,7 +796,7 @@ gimp_display_shell_draw_tri_row_mask (GimpDrawable *texture,
|
|||
break;
|
||||
|
||||
case GIMP_RGBA_IMAGE:
|
||||
while (dx --)
|
||||
while (dx--)
|
||||
{
|
||||
read_pixel_data_1 (tiles, (gint) u, (gint) v, pptr);
|
||||
read_pixel_data_1 (masktiles, (gint) mu, (gint) mv, &maskval);
|
||||
|
|
Loading…
Reference in New Issue