Kaydet (Commit) 5346394e authored tarafından Caolán McNamara's avatar Caolán McNamara

valgrind: Conditional jump or move depends on uninitialised value

Change-Id: I7b59ddc4f9170c33e948f30194a662f27b871fcc
üst 57fb462c
...@@ -114,19 +114,19 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) ...@@ -114,19 +114,19 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
// height of fly frames // height of fly frames
bUseFlyCache = aIo.GetMinorVersion() >= 1; bUseFlyCache = aIo.GetMinorVersion() >= 1;
sal_uInt8 cFlags;
sal_uInt32 nIndex, nOffset;
aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES ); aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES );
aIo.OpenFlagRec(); aIo.OpenFlagRec();
aIo.CloseFlagRec(); aIo.CloseFlagRec();
while( aIo.BytesLeft() && !aIo.HasError() ) while( aIo.BytesLeft() && !aIo.HasError() )
{ {
sal_uInt32 nIndex(0), nOffset(0);
switch( aIo.Peek() ) switch( aIo.Peek() )
{ {
case SW_LAYCACHE_IO_REC_PARA: case SW_LAYCACHE_IO_REC_PARA:
{
aIo.OpenRec( SW_LAYCACHE_IO_REC_PARA ); aIo.OpenRec( SW_LAYCACHE_IO_REC_PARA );
cFlags = aIo.OpenFlagRec(); sal_uInt8 cFlags = aIo.OpenFlagRec();
aIo.GetStream() >> nIndex; aIo.GetStream() >> nIndex;
if( (cFlags & 0x01) != 0 ) if( (cFlags & 0x01) != 0 )
aIo.GetStream() >> nOffset; aIo.GetStream() >> nOffset;
...@@ -136,6 +136,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) ...@@ -136,6 +136,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
Insert( SW_LAYCACHE_IO_REC_PARA, nIndex, (xub_StrLen)nOffset ); Insert( SW_LAYCACHE_IO_REC_PARA, nIndex, (xub_StrLen)nOffset );
aIo.CloseRec( SW_LAYCACHE_IO_REC_PARA ); aIo.CloseRec( SW_LAYCACHE_IO_REC_PARA );
break; break;
}
case SW_LAYCACHE_IO_REC_TABLE: case SW_LAYCACHE_IO_REC_TABLE:
aIo.OpenRec( SW_LAYCACHE_IO_REC_TABLE ); aIo.OpenRec( SW_LAYCACHE_IO_REC_TABLE );
aIo.OpenFlagRec(); aIo.OpenFlagRec();
...@@ -150,8 +151,8 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream ) ...@@ -150,8 +151,8 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY ); aIo.OpenRec( SW_LAYCACHE_IO_REC_FLY );
aIo.OpenFlagRec(); aIo.OpenFlagRec();
aIo.CloseFlagRec(); aIo.CloseFlagRec();
sal_Int32 nX, nY, nW, nH; sal_Int32 nX(0), nY(0), nW(0), nH(0);
sal_uInt16 nPgNum; sal_uInt16 nPgNum(0);
aIo.GetStream() >> nPgNum >> nIndex aIo.GetStream() >> nPgNum >> nIndex
>> nX >> nY >> nW >> nH; >> nX >> nY >> nW >> nH;
SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH ); SwFlyCache* pFly = new SwFlyCache( nPgNum, nIndex, nX, nY, nW, nH );
...@@ -1188,7 +1189,7 @@ sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType ) ...@@ -1188,7 +1189,7 @@ sal_Bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
} }
else else
{ {
sal_uInt32 nVal; sal_uInt32 nVal(0);
*pStream >> nVal; *pStream >> nVal;
sal_uInt8 cRecTyp = (sal_uInt8)nVal; sal_uInt8 cRecTyp = (sal_uInt8)nVal;
if( !nVal || cRecTyp != cType || if( !nVal || cRecTyp != cType ||
...@@ -1266,7 +1267,7 @@ sal_uInt32 SwLayCacheIoImpl::BytesLeft() ...@@ -1266,7 +1267,7 @@ sal_uInt32 SwLayCacheIoImpl::BytesLeft()
sal_uInt8 SwLayCacheIoImpl::Peek() sal_uInt8 SwLayCacheIoImpl::Peek()
{ {
sal_uInt8 c = 0; sal_uInt8 c(0);
if( !bError ) if( !bError )
{ {
sal_uInt32 nPos = pStream->Tell(); sal_uInt32 nPos = pStream->Tell();
...@@ -1292,7 +1293,7 @@ void SwLayCacheIoImpl::SkipRec() ...@@ -1292,7 +1293,7 @@ void SwLayCacheIoImpl::SkipRec()
sal_uInt8 SwLayCacheIoImpl::OpenFlagRec() sal_uInt8 SwLayCacheIoImpl::OpenFlagRec()
{ {
OSL_ENSURE( !bWriteMode, "OpenFlagRec illegal in write mode" ); OSL_ENSURE( !bWriteMode, "OpenFlagRec illegal in write mode" );
sal_uInt8 cFlags; sal_uInt8 cFlags(0);
*pStream >> cFlags; *pStream >> cFlags;
nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F ); nFlagRecEnd = pStream->Tell() + ( cFlags & 0x0F );
return (cFlags >> 4); return (cFlags >> 4);
......
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