forked from old/legacy-imlib2
imlib_save_image(): Check loader return code for errors
Prevents tons of: ==10646== Conditional jump or move depends on uninitialised value(s) ==10646== at 0x4F7D30C: png_write_find_filter (pngwutil.c:2578) ==10646== by 0x4F7568F: png_write_row (pngwrite.c:827) ==10646== by 0x4F751B0: png_write_rows (pngwrite.c:587) ==10646== by 0x4D40C7D: save (loader_png.c:373) ==10646== by 0x1297084: __imlib_SaveImage (image.c:1282) ==10646== by 0x124252B: imlib_save_image (api.c:4615) ==10646== by 0x401990: main (imlib2_conv.c:74) when trying to convert id:000134,src:000105,op:havoc,rep:32.
This commit is contained in:
parent
a2cb5b9c9b
commit
edaf7b669c
|
@ -4603,7 +4603,8 @@ imlib_save_image(const char *filename)
|
|||
CHECK_PARAM_POINTER("imlib_save_image", "filename", filename);
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue