From: Carl Hetherington Date: Sun, 14 Oct 2018 00:28:14 +0000 (+0100) Subject: Try to fix crash when zip_open_from_source returns an error. X-Git-Tag: v2.13.62~14 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=2abb944d5a1c000911de5aafa6079d10b5600db9;p=dcpomatic.git Try to fix crash when zip_open_from_source returns an error. --- diff --git a/src/lib/internet.cc b/src/lib/internet.cc index 662a82443..d6fb02a17 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -119,9 +119,10 @@ get_from_zip_url (string url, string file, bool pasv, function (_("Could not open downloaded ZIP file")); } - zip_t* zip = zip_open_from_source (zip_source, 0, 0); + zip_error_t error; + zip_t* zip = zip_open_from_source (zip_source, ZIP_RDONLY, &error); if (!zip) { - return optional (_("Could not open downloaded ZIP file")); + return String::compose (_("Could not open downloaded ZIP file (%1)"), error.str ? error.str : ""); } #else