fix cell_width calculation again so we don't cut off cells. Don't write

2006-11-01  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpviewrendererpalette.c
	(gimp_view_renderer_palette_render): fix cell_width calculation
	again so we don't cut off cells. Don't write beyond the buffer's
	size, fixes random crashes.
This commit is contained in:
Michael Natterer 2006-11-01 19:13:59 +00:00 committed by Michael Natterer
parent d3bf82ae7a
commit 93caf1f8b1
2 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,10 @@
2006-11-01 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpviewrendererpalette.c
(gimp_view_renderer_palette_render): fix cell_width calculation
again so we don't cut off cells. Don't write beyond the buffer's
size, fixes random crashes.
2006-11-01 Kevin Cozens <kcozens@cvs.gnome.org>
* plug-ins/script-fu/scheme-wrapper.c: Added two missing deprecated

View File

@ -112,7 +112,9 @@ gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
cell_width = (gdouble) renderer->width / 16.0;
}
renderpal->cell_width = MAX (4.0, cell_width);
cell_width = MAX (4.0, cell_width);
renderpal->cell_width = cell_width;
renderpal->columns = (gdouble) renderer->width / cell_width;
@ -188,8 +190,7 @@ gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
if (renderpal->draw_grid && (y % renderpal->cell_height) == 0)
{
memset (dest_row, 0,
renderpal->cell_width * renderpal->columns * 3 + 3);
memset (dest_row, 0, renderer->rowstride);
}
else
{