Browse Source

* Merging revisions 1130,1138 from trunk:
------------------------------------------------------------------------
r1130 | michael | 2021-04-04 11:28:37 +0200 (Sun, 04 Apr 2021) | 1 line

* Fix ObjectBinaryToStream: read filer signature
------------------------------------------------------------------------
r1138 | michael | 2021-04-05 15:37:50 +0200 (Mon, 05 Apr 2021) | 1 line

* Undo latest change
------------------------------------------------------------------------

michael 4 years ago
parent
commit
a6a5beb1fd
1 changed files with 6 additions and 2 deletions
  1. 6 2
      packages/rtl/classes.pas

+ 6 - 2
packages/rtl/classes.pas

@@ -9998,14 +9998,18 @@ end;
 
 
 procedure TObjectStreamConverter.Execute;
 procedure TObjectStreamConverter.Execute;
 
 
+var
+  Signature: LongInt;
+
 begin
 begin
   if FIndent = '' then FInDent:='  ';
   if FIndent = '' then FInDent:='  ';
   If Not Assigned(Input) then
   If Not Assigned(Input) then
     raise EReadError.Create('Missing input stream');
     raise EReadError.Create('Missing input stream');
   If Not Assigned(Output) then
   If Not Assigned(Output) then
     raise EReadError.Create('Missing output stream');
     raise EReadError.Create('Missing output stream');
-  if Input.ReadDWord <> FilerSignatureInt then
-    raise EReadError.Create('Illegal stream image');
+  FInput.ReadBufferData(Signature);
+  if Signature <> FilerSignatureInt then
+    raise EReadError.Create(SInvalidImage);
   ReadObject('');
   ReadObject('');
 end;
 end;