Add a new function exif_init_cache() and call it at top of exif_read_fd(),
the issue was caused by a return NULL on unreadable file, before initializinf exif_cache
and when exif_free_fd() is called, file_cache_put() was called on invalid cache.
fd->exif = NULL;
}
+void exif_init_cache(void)
+{
+ assert(!exif_cache);
+ exif_cache = file_cache_new(exif_release_cb, 4);
+}
+
ExifData *exif_read_fd(FileData *fd)
{
gchar *sidecar_path;
+
+ if (!exif_cache) exif_init_cache();
if (!fd || !is_readable_file(fd->path)) return NULL;
- if (!exif_cache) exif_cache = file_cache_new(exif_release_cb, 4);
-
if (file_cache_get(exif_cache, fd)) return fd->exif;
/* CACHE_TYPE_XMP_METADATA file should exist only if the metadata are