fix: crashing on bad exif thumbnail (#75)

this does not need to be a fatal error.
if im is NULL we're going to load it with imlib2 anyways.

one other problem this solves is that before, due to the fatal error,
the tmpfile opened under /tmp wouldn't get cleaned up.

Closes: https://github.com/nsxiv/nsxiv/issues/69
This commit is contained in:
N-R-K 2021-09-29 09:44:46 +06:00 committed by GitHub
parent 0ee05d29f0
commit 80c5a1cd9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -312,7 +312,7 @@ bool tns_load(tns_t *tns, int n, bool force, bool cache_only)
} }
if (w >= maxwh || h >= maxwh) { if (w >= maxwh || h >= maxwh) {
if ((im = imlib_create_cropped_image(x, y, w, h)) == NULL) if ((im = imlib_create_cropped_image(x, y, w, h)) == NULL)
error(EXIT_FAILURE, ENOMEM, NULL); error(0, 0, "%s: error generating thumbnail", file->name);
} }
imlib_free_image_and_decache(); imlib_free_image_and_decache();
} }