summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/fontsubset/cff.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 1bb6f06f437f..1d22d09ea9af 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1778,11 +1778,14 @@ size_t Type1Emitter::updateLen( int nTellPos, size_t nLength)
cData[1] = static_cast<U8>(nLength >> 8);
cData[2] = static_cast<U8>(nLength >> 16);
cData[3] = static_cast<U8>(nLength >> 24);
- const long nCurrPos = ftell( mpFileOut);
- fseek( mpFileOut, nTellPos, SEEK_SET);
- size_t nWrote = fwrite( cData, 1, sizeof(cData), mpFileOut);
+ const long nCurrPos = ftell(mpFileOut);
+ if (nCurrPos < 0)
+ return 0;
+ if (fseek( mpFileOut, nTellPos, SEEK_SET) != 0)
+ return 0;
+ size_t nWrote = fwrite(cData, 1, sizeof(cData), mpFileOut);
if( nCurrPos >= 0)
- fseek( mpFileOut, nCurrPos, SEEK_SET);
+ (void)fseek(mpFileOut, nCurrPos, SEEK_SET);
return nWrote;
}