You've already forked lazarus-ccr
fpspreadsheet: Fix xls reader crashing if comment has record sequence OBJ-CONTINUE-TX0-CONTINUE instead of OBJ-TX0-CONTINUE.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6214 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -537,7 +537,7 @@ var
|
|||||||
comment: TBIFF8Comment;
|
comment: TBIFF8Comment;
|
||||||
rtParams: TsRichTextParams;
|
rtParams: TsRichTextParams;
|
||||||
begin
|
begin
|
||||||
if FCommentPending then begin
|
if FCommentPending and (FCommentLen > 0) then begin
|
||||||
commentStr := Utf8Encode(ReadWideString(AStream, FCommentLen, rtParams));
|
commentStr := Utf8Encode(ReadWideString(AStream, FCommentLen, rtParams));
|
||||||
if commentStr <> '' then
|
if commentStr <> '' then
|
||||||
begin
|
begin
|
||||||
@ -605,6 +605,7 @@ begin
|
|||||||
if objType = $19 then begin // $19 = object is a "comment"
|
if objType = $19 then begin // $19 = object is a "comment"
|
||||||
FCommentPending := true;
|
FCommentPending := true;
|
||||||
FCommentID := objID;
|
FCommentID := objID;
|
||||||
|
FCommentLen := 0; // will be determined in following TX0 record
|
||||||
exit;
|
exit;
|
||||||
end else
|
end else
|
||||||
FCommentPending := false;
|
FCommentPending := false;
|
||||||
@ -886,6 +887,9 @@ begin
|
|||||||
RecordSize := WordLEToN(AStream.ReadWord);
|
RecordSize := WordLEToN(AStream.ReadWord);
|
||||||
PendingRecordSize := RecordSize;
|
PendingRecordSize := RecordSize;
|
||||||
|
|
||||||
|
// For debugging to find out in which record a crash happens:
|
||||||
|
// WriteLn(Format('Stream.Pos: %d, RecordType: $%.04x, RecordSize: %d', [AStream.Position-4, RecordType, RecordSize]));
|
||||||
|
|
||||||
CurStreamPos := AStream.Position;
|
CurStreamPos := AStream.Position;
|
||||||
|
|
||||||
case RecordType of
|
case RecordType of
|
||||||
|
Reference in New Issue
Block a user