vcl/source/filter/igif/gifread.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
New commits: commit 0de5101df0a8db41ad067b2575d16fd9b5a9a751 Author: Mark Page <aptit...@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 <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits