diff options
-rw-r--r-- | sdext/source/pdfimport/pdfparse/pdfentries.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 57b7b55f2986..9374e20f12bc 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -703,10 +703,11 @@ static void unzipToBuffer( const char* pBegin, unsigned int nLen, { if( err != Z_STREAM_END ) { - *pOutLen += buf_increment_size; - *pOutBuf = (sal_uInt8*)rtl_reallocateMemory( *pOutBuf, *pOutLen ); + const int nNewAlloc = *pOutLen + buf_increment_size; + *pOutBuf = (sal_uInt8*)rtl_reallocateMemory( *pOutBuf, nNewAlloc ); aZStr.next_out = (Bytef*)(*pOutBuf + *pOutLen); aZStr.avail_out = buf_increment_size; + *pOutLen = nNewAlloc; } } } |