[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 30 06:31:41 UTC 2018


 vcl/source/filter/igif/decode.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit ab6da907521514cfa85eb8e5786a9c9bae3ceb2e
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 29 15:01:55 2018 +0200
Commit:     Noel Grandin <noel.grandin at 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.grandin at 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 );


More information about the Libreoffice-commits mailing list