mirror of https://github.com/GNOME/gimp.git
fix a few potential use-before-check errors
Spotted by Andrey Karpov using static code analysis: http://www.viva64.com/en/b/0273/
This commit is contained in:
parent
a102690145
commit
7928be2255
|
@ -893,7 +893,7 @@ update_preview (gint32 *id_ptr)
|
|||
|
||||
if (g_Sdebug)
|
||||
printf ("UPD PREVIEWS ID:%d ENABLE_UPD:%d\n",
|
||||
(int)*id_ptr, (int)g_di.enable_preview_update);
|
||||
id_ptr ? (int) *id_ptr : -1, (int)g_di.enable_preview_update);
|
||||
|
||||
if (id_ptr == NULL || !g_di.enable_preview_update)
|
||||
return;
|
||||
|
|
|
@ -1505,8 +1505,7 @@ add_layers (gint32 image_id,
|
|||
gimp_layer_set_apply_mask (layer_id,
|
||||
! lyr_a[lidx]->layer_mask.mask_flags.disabled);
|
||||
}
|
||||
if (pixels)
|
||||
g_free (pixels);
|
||||
g_free (pixels);
|
||||
}
|
||||
}
|
||||
for (cidx = 0; cidx < lyr_a[lidx]->num_channels; ++cidx)
|
||||
|
|
|
@ -533,9 +533,11 @@ ObjectList_t*
|
|||
object_list_append_list(ObjectList_t *des, ObjectList_t *src)
|
||||
{
|
||||
GList *p;
|
||||
if (!src)
|
||||
return des;
|
||||
for (p = src->list; p; p = p->next)
|
||||
object_list_append(des, object_clone((Object_t*) p->data));
|
||||
object_list_set_changed(des, (src) ? TRUE : FALSE);
|
||||
object_list_set_changed(des, TRUE);
|
||||
return des;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue