diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-12 10:39:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-12 12:25:19 +0000 |
commit | c6bad400de605adf9c4cb32663b0f3610dab7024 (patch) | |
tree | 2be6f239ad42776adf3cec6c949c16ac685406e9 /vcl | |
parent | 8d38824b3866d5a1da7d792bd06613ecc4c52be5 (diff) |
coverity#735344 Unchecked return value from library
Change-Id: I6dbb5ce74225e092d4098174fd4b53aa8c4201fa
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/fontsubset/cff.cxx | 11 |
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; } |