diff options
author | Hossein <hossein@libreoffice.org> | 2021-11-25 18:24:46 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-26 13:31:01 +0100 |
commit | 149bd802623d6d83ec9aa04514b938494f7f01f6 (patch) | |
tree | 3ad911bd5631dbf8a449c110f9e9c7368bc58efd /emfio | |
parent | 00455b22f0544159e60e9f9f9fd1a7c41855fb58 (diff) |
tdf#145873 Fix FILEOPEN: EMF file not displayed
EMF can have WMF embedded inside it. The sample PPTX file contains an
EMF file consisting of several GDIcomment records in which embed a
Placeable WMF file without some records related to the size of the
WMF. It reaches pStm->SetError( SVSTREAM_FILEFORMAT_ERROR ); in
emfio/source/reader/wmfreader.cxx:1982 which causes to the problem
in loading the file.
With this fix, the EMF file will be displayed. Without the fix, the
EMF file will be displayed as blank.
Regression from
commit 5e4e1cdb1e14354b42838e1dfcf82873b3071896
tdf#88163 Fix font size for placeable wmf files
The fix can be tested with:
make CPPUNIT_TEST_NAME="testTdf145873" -sr \
CppunitTest_sd_svg_export_tests
Change-Id: I04babd5029ba123fdd03758eef2be69faf45fda8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125796
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index eeb6e106cf00..47513101777d 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -44,6 +44,7 @@ namespace // MS Windows defines enum WMFRecords { + W_META_EOF = 0x0000, W_META_SETBKCOLOR = 0x0201, W_META_SETBKMODE = 0x0102, W_META_SETMAPMODE = 0x0103, @@ -1572,7 +1573,7 @@ namespace emfio if ( !mpInputStream->good() || (mnRecSize < 3) || - (mnRecSize == 3 && nFunction == 0) + (mnRecSize == 3 && nFunction == W_META_EOF) ) { if( mpInputStream->eof() ) @@ -1689,7 +1690,7 @@ namespace emfio bRet = false; break; } - else if ( nRSize==3 && nFunction==0 ) + else if ( nFunction == W_META_EOF ) { break; } |