imlib_save_image_with_error_return(): Check loader return code to prevent use of unitialized memor

This commit is contained in:
Fabian Keil 2014-12-04 14:05:25 +01:00 committed by Carsten Haitzler (Rasterman)
parent 6ef51ec4cd
commit 60779351df
1 changed files with 2 additions and 1 deletions

View File

@ -4636,7 +4636,8 @@ imlib_save_image_with_error_return(const char *filename,
error_return);
CAST_IMAGE(im, ctx->image);
if ((!(im->data)) && (im->loader) && (im->loader->load))
im->loader->load(im, NULL, 0, 1);
if (!im->loader->load(im, NULL, 0, 1))
return;
if (!im->data)
return;
prev_ctxt_image = ctx->image;