vcl/source/filter/igif/decode.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
New commits: commit ab6da907521514cfa85eb8e5786a9c9bae3ceb2e Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Aug 29 15:01:55 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Aug 30 08:31:13 2018 +0200 use realloc instead of malloc+memcpy Change-Id: Ia69be8db2b735c28cc69f478efcff3b6a2cdbbf2 Reviewed-on: https://gerrit.libreoffice.org/59775 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx index 8cbb52c9f9d8..276d75c64e24 100644 --- a/vcl/source/filter/igif/decode.cxx +++ b/vcl/source/filter/igif/decode.cxx @@ -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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits