[Libreoffice-commits] core.git: Branch 'libreoffice-5-0-0' - vcl/source

Caolán McNamara caolanm at redhat.com
Wed Jul 15 02:40:35 PDT 2015


 vcl/source/filter/igif/decode.cxx |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 481a564d97b02cc8f6d21672994c55d3b2ddc137
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 14 12:43:05 2015 +0100

    use same limit in ProcessOneCode as AddToTable
    
    Change-Id: Id0345e5d867d18bf7eb341f04086226b7fa79680
    (cherry picked from commit 59197f1892777a5629bad210b9ed1071ed550570)
    Reviewed-on: https://gerrit.libreoffice.org/17042
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx
index 2b445e9..0008f63 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -109,11 +109,9 @@ HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, sal_uInt8 cBufSize,
 
 bool GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirstData )
 {
-    GIFLZWTableEntry* pE;
-
     if( nTableSize < 4096 )
     {
-        pE = pTable + nTableSize;
+        GIFLZWTableEntry* pE = pTable + nTableSize;
         pE->pPrev = pTable + nPrevCode;
         pE->pFirst = pE->pPrev->pFirst;
         GIFLZWTableEntry *pEntry = pTable[nCodeFirstData].pFirst;
@@ -130,7 +128,6 @@ bool GIFLZWDecompressor::AddToTable( sal_uInt16 nPrevCode, sal_uInt16 nCodeFirst
 
 bool GIFLZWDecompressor::ProcessOneCode()
 {
-    GIFLZWTableEntry*   pE;
     sal_uInt16              nCode;
     bool                bRet = false;
     bool                bEndOfBlock = false;
@@ -193,11 +190,11 @@ bool GIFLZWDecompressor::ProcessOneCode()
 
         nOldCode = nCode;
 
-        if (nCode > 4096)
+        if (nCode >= 4096)
             return false;
 
         // write character(/-sequence) of code nCode in the output buffer:
-        pE = pTable + nCode;
+        GIFLZWTableEntry* pE = pTable + nCode;
         do
         {
             if (pOutBufData == pOutBuf) //can't go back past start


More information about the Libreoffice-commits mailing list