do not call bounds() and recalc() with a NULL display. Added sanity checks

2006-06-27  Sven Neumann  <sven@gimp.org>

	* app/tools/gimptransformtool.c
(gimp_transform_tool_notify_type):
	do not call bounds() and recalc() with a NULL display.  Added
	sanity checks for the display parameter to both functions.
	Fixes bug #345791.
This commit is contained in:
Sven Neumann 2006-06-27 18:52:24 +00:00 committed by Sven Neumann
parent 5e197c16a6
commit 9c445e8d47
2 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2006-06-27 Sven Neumann <sven@gimp.org>
* app/tools/gimptransformtool.c (gimp_transform_tool_notify_type):
do not call bounds() and recalc() with a NULL display. Added
sanity checks for the display parameter to both functions.
Fixes bug #345791.
2006-06-27 Sven Neumann <sven@gimp.org>
* plug-ins/imagemap/imap_menu.c: commented out the non-functional

View file

@ -1256,6 +1256,8 @@ gimp_transform_tool_bounds (GimpTransformTool *tr_tool,
{
GimpTransformOptions *options;
g_return_if_fail (GIMP_IS_DISPLAY (display));
options =
GIMP_TRANSFORM_OPTIONS (GIMP_TOOL (tr_tool)->tool_info->tool_options);
@ -1471,6 +1473,8 @@ void
gimp_transform_tool_recalc (GimpTransformTool *tr_tool,
GimpDisplay *display)
{
g_return_if_fail (GIMP_IS_DISPLAY (display));
if (GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->recalc)
GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->recalc (tr_tool, display);
@ -1530,6 +1534,8 @@ gimp_transform_tool_notify_type (GimpTransformOptions *options,
GParamSpec *pspec,
GimpTransformTool *tr_tool)
{
GimpDisplay *display = GIMP_TOOL (tr_tool)->display;
if (tr_tool->function != TRANSFORM_CREATING)
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tr_tool));
@ -1538,11 +1544,14 @@ gimp_transform_tool_notify_type (GimpTransformOptions *options,
if (tr_tool->function != TRANSFORM_CREATING)
{
/* reget the selection bounds */
gimp_transform_tool_bounds (tr_tool, GIMP_TOOL (tr_tool)->display);
if (display)
{
/* reget the selection bounds */
gimp_transform_tool_bounds (tr_tool, display);
/* recalculate the tool's transformation matrix */
gimp_transform_tool_recalc (tr_tool, GIMP_TOOL (tr_tool)->display);
/* recalculate the tool's transformation matrix */
gimp_transform_tool_recalc (tr_tool, display);
}
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tr_tool));
}