|
@@ -239,13 +239,16 @@ end;
|
|
|
|
|
|
function TFPCustomImageReader.CheckContents (Str:TStream) : boolean;
|
|
function TFPCustomImageReader.CheckContents (Str:TStream) : boolean;
|
|
var InRead : boolean;
|
|
var InRead : boolean;
|
|
|
|
+ P : Int64;
|
|
begin
|
|
begin
|
|
InRead := assigned(FStream);
|
|
InRead := assigned(FStream);
|
|
if not assigned(Str) then
|
|
if not assigned(Str) then
|
|
raise FPImageException.Create(ErrorText[StrNoStream]);
|
|
raise FPImageException.Create(ErrorText[StrNoStream]);
|
|
try
|
|
try
|
|
FSTream := Str;
|
|
FSTream := Str;
|
|
|
|
+ P:=Str.Position;
|
|
result := InternalCheck (Str);
|
|
result := InternalCheck (Str);
|
|
|
|
+ Str.Position:=P;
|
|
finally
|
|
finally
|
|
if not InRead then
|
|
if not InRead then
|
|
FStream := nil;
|
|
FStream := nil;
|