summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEduard Braun <Eduard.Braun2@gmx.de>2017-06-20 23:44:34 +0000
committerEduard Braun <Eduard.Braun2@gmx.de>2017-06-20 23:44:34 +0000
commit49ea08c12ce0f931ba7fc79d8ad9f2fa42a7dca7 (patch)
tree2762a34fc971b93d406e9276abf62550857076cd /src
parentappveyor: updated libgc and gtest now live (diff)
downloadinkscape-49ea08c12ce0f931ba7fc79d8ad9f2fa42a7dca7.tar.gz
inkscape-49ea08c12ce0f931ba7fc79d8ad9f2fa42a7dca7.zip
Fix a crash in CUSTOM_TYPE Windows native file save dialogs
Fixed bugs: - https://bugs.launchpad.net/inkscape/+bug/1639701
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index 1efec7d52..6c8ce2620 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -1685,28 +1685,28 @@ void FileSaveDialogImplWin32::addFileType(Glib::ustring name, Glib::ustring patt
knownExtensions.clear();
- int extension_index = 0;
- int filter_length = 1;
-
- ustring all_exe_files_filter = pattern;
Filter all_exe_files;
const gchar *all_exe_files_filter_name = name.data();
+ const gchar *all_exe_files_filter = pattern.data();
// Calculate the amount of memory required
int filter_count = 1;
-
+ int filter_length = 1;
// Filter Executable Files
all_exe_files.name = g_utf8_to_utf16(all_exe_files_filter_name,
-1, NULL, &all_exe_files.name_length, NULL);
- all_exe_files.filter = g_utf8_to_utf16(all_exe_files_filter.data(),
+ all_exe_files.filter = g_utf8_to_utf16(all_exe_files_filter,
-1, NULL, &all_exe_files.filter_length, NULL);
all_exe_files.mod = NULL;
filter_list.push_front(all_exe_files);
+
+ filter_length = all_exe_files.name_length + all_exe_files.filter_length + 3; // Add 3 for two \0s and a *
knownExtensions.insert( Glib::ustring(all_exe_files_filter).casefold() );
+ int extension_index = 0;
_extension_map = new Inkscape::Extension::Extension*[filter_count];
_filter = new wchar_t[filter_length];