Kaydet (Commit) 379d6a5a authored tarafından Caolán McNamara's avatar Caolán McNamara

handle erronous fExtChar safely

üst 53c45468
...@@ -1486,9 +1486,9 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const ...@@ -1486,9 +1486,9 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
if( nFcPos == WW8_FC_MAX ) if( nFcPos == WW8_FC_MAX )
return nFallBackCpEnd; return nFallBackCpEnd;
bool bIsUnicode = false;
if( pPieceIter ) // Complex File ? if( pPieceIter ) // Complex File ?
{ {
bool bIsUnicode = false;
ULONG nOldPos = pPieceIter->GetIdx(); ULONG nOldPos = pPieceIter->GetIdx();
for (pPieceIter->SetIdx(0); for (pPieceIter->SetIdx(0);
...@@ -1546,9 +1546,11 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const ...@@ -1546,9 +1546,11 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
return nFallBackCpEnd; return nFallBackCpEnd;
} }
// No complex file // No complex file
if (pWw8Fib->fExtChar) if (!pWw8Fib->fExtChar)
bIsUnicode=true; nFallBackCpEnd = (nFcPos - pWw8Fib->fcMin);
return ((nFcPos - pWw8Fib->fcMin) / (bIsUnicode ? 2 : 1)); else
nFallBackCpEnd = (nFcPos - pWw8Fib->fcMin + 1) / 2;
return nFallBackCpEnd;
} }
WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode, WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
......
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