[Libreoffice-commits] core.git: vcl/source
Mark Page
aptitude at btconnect.com
Wed Nov 30 22:06:23 UTC 2016
vcl/source/filter/igif/gifread.cxx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
New commits:
commit 0de5101df0a8db41ad067b2575d16fd9b5a9a751
Author: Mark Page <aptitude at btconnect.com>
Date: Wed Nov 30 10:22:47 2016 +0000
When overreading gif sub blocks, do not read skipped bytes
We do not require to read in gif extension data when it is ignored
This is used to skip the Adobe XMP gif extension
Change-Id: Id64f373a4eae764227c0b7ac6687697666991ec7
Reviewed-on: https://gerrit.libreoffice.org/31410
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 7588970..1bfae2f 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -307,7 +307,6 @@ bool GIFReader::ReadExtension()
sal_uInt8 cSize(0);
// Block length
rIStm.ReadUChar( cSize );
-
switch( cFunction )
{
// 'Graphic Control Extension'
@@ -412,13 +411,14 @@ bool GIFReader::ReadExtension()
const sal_uInt64 nMaxPossible = rIStm.remainingSize();
if (nCount > nMaxPossible)
nCount = nMaxPossible;
- std::unique_ptr<sal_uInt8[]> pBuffer(new sal_uInt8[nCount]);
+
+ if (nCount)
+ rIStm.SeekRel( nCount - 1 ); // Skip subblock data
bRet = false;
- std::size_t nRead = rIStm.ReadBytes(pBuffer.get(), nCount);
- if (NO_PENDING(rIStm) && cSize < nRead)
+ std::size_t nRead = rIStm.ReadBytes(&cSize, 1);
+ if (NO_PENDING(rIStm) && nRead == 1)
{
- cSize = pBuffer[cSize];
bRet = true;
}
else
More information about the Libreoffice-commits
mailing list