r19393 by jghali - #12580 : trying to import emf disguised as wmf cause crash

scribus-commit scribus-commit at lists.scribus.net
Fri Aug 1 11:37:15 UTC 2014


Author: jghali
Date: Fri Aug  1 11:37:15 2014
New Revision: 19393

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19393
Log:
#12580 : trying to import emf disguised as wmf cause crash

Modified:
    branches/Version14x/Scribus/scribus/plugins/import/wmf/wmfimport.cpp

Modified: branches/Version14x/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19393&path=/branches/Version14x/Scribus/scribus/plugins/import/wmf/wmfimport.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/import/wmf/wmfimport.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/import/wmf/wmfimport.cpp Fri Aug  1 11:37:15 2014
@@ -486,7 +486,7 @@
 
 	//----- Test header validity
 	m_Valid = ((header.mtHeaderSize == 9) && (header.mtNoParameters == 0)) || m_IsEnhanced || m_IsPlaceable;
-	if ( m_Valid )
+	if ( m_Valid && !m_IsEnhanced )
 	{
 		//----- Read Metafile Records
 		rdFunc = -1;
@@ -529,12 +529,15 @@
 			cerr << "WMF : incorrect file format !" << endl;
 		}
 	}
+	else if ( m_IsEnhanced ) {
+		cerr << "WMF : unsupported Enhanced Metafile !" << endl;
+	}
 	else {
 		cerr << "WMF Header : incorrect header !" << endl;
 	}
 
 	buffer.close();
-	return m_Valid;
+	return (m_Valid && !m_IsEnhanced);
 }
 
 bool WMFImport::importWMF(const TransactionSettings& trSettings, int flags)




More information about the scribus-commit mailing list