Kaydet (Commit) cc1a7748 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Caolán McNamara

Resolves: #i124555# restore stream position after Seek to end of stream

(cherry picked from commit 61efddf5)

Conflicts:
	vcl/source/gdi/dibtools.cxx

Change-Id: Ie6c0aeab5988b68954a0bdd460317ac9539d8a5f
üst 994da4b9
......@@ -766,17 +766,18 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
{
sal_uInt32 nTmp32;
sal_uInt16 nTmp16 = 0;
bool bRet = false;
bool bRet = false;
const sal_uLong nStreamLength (rIStm.Seek(STREAM_SEEK_TO_END));
rIStm.Seek(STREAM_SEEK_TO_BEGIN);
const sal_uInt64 nSavedStreamPos( rIStm.Tell() );
const sal_uInt64 nStreamLength( rIStm.Seek( STREAM_SEEK_TO_END ) );
rIStm.Seek( nSavedStreamPos );
sal_uInt16 nTmp16 = 0;
rIStm.ReadUInt16( nTmp16 );
if ( ( 0x4D42 == nTmp16 ) || ( 0x4142 == nTmp16 ) )
{
sal_uInt32 nTmp32(0);
if ( 0x4142 == nTmp16 )
{
rIStm.SeekRel( 12L );
......@@ -794,7 +795,7 @@ bool ImplReadDIBFileHeader( SvStream& rIStm, sal_uLong& rOffset )
bRet = ( rIStm.GetError() == 0UL );
}
if (rOffset >= nStreamLength)
if ( rOffset >= nStreamLength )
{
// Offset claims that image starts past the end of the
// stream. Unlikely.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment