diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2013-11-06 17:57:09 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-11-12 17:02:54 +0100 |
commit | 484b1e6ea4e65f225f4694de006a22a69d734c76 (patch) | |
tree | 9743df7d005f306967b40b6f170f6daab2f013a7 | |
parent | 44952d7e621c43b43163b15e4af7f452e35a0114 (diff) |
Resolves: fdo#71309 Export SWF with Multiple files crashes
In case of unamed file, creation of sPresentationName crash.
This patch forces creation of empty name
Change-Id: I1b5319eb945f1959f2ad3c703365539508521861
Reviewed-on: https://gerrit.libreoffice.org/6598
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 2cf96ae334491733a2bdbeb003da6e49df19cc9f)
-rw-r--r-- | filter/source/flash/swffilter.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index e08667e0c84b..4d0ace89759d 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -285,16 +285,20 @@ sal_Bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue // AS: sPath is the parent directory, where everything else exists (like the sxi, // the -swf-files folder, the -audio files, etc. - int lastslash = sOriginalPath.lastIndexOf('/'); + sal_Int32 lastslash = sOriginalPath.lastIndexOf('/'); OUString sPath( sOriginalPath.copy(0, lastslash) ); OUString sPresentation(xStorable->getLocation()); lastslash = sPresentation.lastIndexOf('/') + 1; - int lastdot = sPresentation.lastIndexOf('.'); + sal_Int32 lastdot = sPresentation.lastIndexOf('.'); // AS: The name of the presentation, without 3 character extension. - OUString sPresentationName = sPresentation.copy(lastslash, lastdot - lastslash); + OUString sPresentationName; + if (lastdot < 0) // fdo#71309 in case file has no name + sPresentationName = sPresentation.copy(lastslash); + else + sPresentationName = sPresentation.copy(lastslash, lastdot - lastslash); OUString fullpath, swfdirpath, backgroundfilename, objectsfilename; |