don't dereference gimp->current_plug_in->plug_in_def if it's NULL. Fixes

2004-08-09  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-ins.c
	(plug_ins_file_register_magic)
	(plug_ins_file_register_mime): don't dereference
	gimp->current_plug_in->plug_in_def if it's NULL.
	Fixes bug #149678.

	(plug_ins_file_register_mime): moved returning the proc_def inside
	the right if() statement.
This commit is contained in:
Michael Natterer 2004-08-09 10:25:50 +00:00 committed by Michael Natterer
parent 00e8541ec4
commit 8f366beff9
3 changed files with 19 additions and 8 deletions

View file

@ -1,3 +1,14 @@
2004-08-09 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-ins.c
(plug_ins_file_register_magic)
(plug_ins_file_register_mime): don't dereference
gimp->current_plug_in->plug_in_def if it's NULL.
Fixes bug #149678.
(plug_ins_file_register_mime): moved returning the proc_def inside
the right if() statement.
2004-08-09 Hans Breuer <hans@breuer.org>
* app/core/gimp-edit.c(gimp_edit_paste_as_new) :

View file

@ -431,7 +431,7 @@ plug_ins_file_register_magic (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (name != NULL, NULL);
if (gimp->current_plug_in)
if (gimp->current_plug_in && gimp->current_plug_in->plug_in_def)
list = gimp->current_plug_in->plug_in_def->proc_defs;
else
list = gimp->plug_in_proc_defs;
@ -490,7 +490,7 @@ plug_ins_file_register_mime (Gimp *gimp,
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (mime_type != NULL, NULL);
if (gimp->current_plug_in)
if (gimp->current_plug_in && gimp->current_plug_in->plug_in_def)
list = gimp->current_plug_in->plug_in_def->proc_defs;
else
list = gimp->plug_in_proc_defs;
@ -504,9 +504,9 @@ plug_ins_file_register_mime (Gimp *gimp,
if (proc_def->mime_type)
g_free (proc_def->mime_type);
proc_def->mime_type = g_strdup (mime_type);
}
return proc_def;
return proc_def;
}
}
return NULL;

View file

@ -431,7 +431,7 @@ plug_ins_file_register_magic (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (name != NULL, NULL);
if (gimp->current_plug_in)
if (gimp->current_plug_in && gimp->current_plug_in->plug_in_def)
list = gimp->current_plug_in->plug_in_def->proc_defs;
else
list = gimp->plug_in_proc_defs;
@ -490,7 +490,7 @@ plug_ins_file_register_mime (Gimp *gimp,
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (mime_type != NULL, NULL);
if (gimp->current_plug_in)
if (gimp->current_plug_in && gimp->current_plug_in->plug_in_def)
list = gimp->current_plug_in->plug_in_def->proc_defs;
else
list = gimp->plug_in_proc_defs;
@ -504,9 +504,9 @@ plug_ins_file_register_mime (Gimp *gimp,
if (proc_def->mime_type)
g_free (proc_def->mime_type);
proc_def->mime_type = g_strdup (mime_type);
}
return proc_def;
return proc_def;
}
}
return NULL;