You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by hd...@apache.org on 2012/06/14 11:42:47 UTC

svn commit: r1350167 - /incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx

Author: hdu
Date: Thu Jun 14 09:42:47 2012
New Revision: 1350167

URL: http://svn.apache.org/viewvc?rev=1350167&view=rev
Log:
#c705440# check ftell return value when emitting Type1 subset

Modified:
    incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx

Modified: incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx?rev=1350167&r1=1350166&r2=1350167&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/fontsubset/cff.cxx Thu Jun 14 09:42:47 2012
@@ -1889,20 +1889,20 @@ public:
 	void		emitAllRaw( void);
 	void		emitAllHex( void);
 	void		emitAllCrypted( void);
-	int			tellPos( void) const;
+	int		tellPos( void) const;
 	void		updateLen( int nTellPos, int nLength);
 	void		emitValVector( const char* pLineHead, const char* pLineTail, const ValVector&);
 private:
 	FILE*		mpFileOut;
 	bool		mbCloseOutfile;
 	char		maBuffer[MAX_T1OPS_SIZE];	// TODO: dynamic allocation
-	int			mnEECryptR;
+	int		mnEECryptR;
 public:
 	char*		mpPtr;
 
 	char		maSubsetName[256];
 	bool		mbPfbSubset;
-	int			mnHexLineCol;
+	int		mnHexLineCol;
 };
 
 // --------------------------------------------------------------------
@@ -1971,10 +1971,11 @@ void Type1Emitter::updateLen( int nTellP
 	cData[1] = static_cast<U8>(nLength >>  8);
 	cData[2] = static_cast<U8>(nLength >> 16);
 	cData[3] = static_cast<U8>(nLength >> 24);
-	const int nCurrPos = ftell( mpFileOut);
+	const long nCurrPos = ftell( mpFileOut);
 	fseek( mpFileOut, nTellPos, SEEK_SET);
 	fwrite( cData, 1, sizeof(cData), mpFileOut);
-	fseek( mpFileOut, nCurrPos, SEEK_SET);
+	if( nCurrPos >= 0)
+		fseek( mpFileOut, nCurrPos, SEEK_SET);
 }
 
 // --------------------------------------------------------------------