plug-ins: fix crash when loading multi page TIFF images in non interactive mode
When loading a TIFF image using a script/plug-in in non interactive mode, we did not initialize the list of pages, causing a crash when trying to access it. So, always initialize this list when non interactive.
This commit is contained in:
@ -345,9 +345,11 @@ load_image (GFile *file,
|
||||
for (li = 0; li < pages.n_pages; li++)
|
||||
pages.filtered_pages[li] = li;
|
||||
|
||||
if (pages.n_pages == 1)
|
||||
if (pages.n_pages == 1 || run_mode != GIMP_RUN_INTERACTIVE)
|
||||
{
|
||||
pages.pages = g_new0 (gint, pages.n_pages);
|
||||
for (li = 0; li < pages.n_pages; li++)
|
||||
pages.pages[li] = li;
|
||||
pages.target = GIMP_PAGE_SELECTOR_TARGET_LAYERS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user