Kaydet (Commit) ab6da907 authored tarafından Noel Grandin's avatar Noel Grandin

use realloc instead of malloc+memcpy

Change-Id: Ia69be8db2b735c28cc69f478efcff3b6a2cdbbf2
Reviewed-on: https://gerrit.libreoffice.org/59775
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 27d03cc3
......@@ -79,13 +79,10 @@ Scanline GIFLZWDecompressor::DecompressBlock( sal_uInt8* pSrc, sal_uInt8 cBufSiz
{
sal_uLong nNewSize = nTargetSize << 1;
sal_uLong nOffset = pTmpTarget - pTarget;
sal_uInt8* pTmp = static_cast<sal_uInt8*>(std::malloc( nNewSize ));
memcpy( pTmp, pTarget, nTargetSize );
std::free( pTarget );
pTarget = static_cast<sal_uInt8*>(std::realloc( pTarget, nNewSize ));
nTargetSize = nNewSize;
pTmpTarget = ( pTarget = pTmp ) + nOffset;
pTmpTarget = pTarget + nOffset;
}
memcpy( pTmpTarget, pOutBufData, nOutBufDataLen );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment