Commit 7f0e71db authored by Karthikeyan S's avatar Karthikeyan S Committed by Mukund Sivaraman

file-pdf-load: Fix possible uninitialised variable access

Print a message to the user if poppler returns n_pages = 0.
Return to file open dialog.
This way we prevent uninitialised variable access down the line.
parent e3f939f9
......@@ -1101,6 +1101,13 @@ load_dialog (PopplerDocument *doc,
gtk_widget_show (selector);
n_pages = poppler_document_get_n_pages (doc);
if (n_pages <= 0)
{
gimp_message (_("Error getting number of pages from the given pdf file\n"));
return FALSE;
}
gimp_page_selector_set_n_pages (GIMP_PAGE_SELECTOR (selector), n_pages);
gimp_page_selector_set_target (GIMP_PAGE_SELECTOR (selector),
loadvals.target);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment