* Implement InternalCheck (By Ondrey Pokorny, Bug ID #29985)

git-svn-id: trunk@33465 -
This commit is contained in:
michael 2016-04-10 06:53:20 +00:00
parent 12f11284bf
commit 1ef0ce2d92

View File

@ -451,11 +451,11 @@ begin
end;
function TFPReaderJPEG.InternalCheck(Str: TStream): boolean;
var
Buf: array[0..1] of Byte = (0, 0);
begin
// ToDo: read header and check
Result:=false;
if Str=nil then exit;
Result:=true;
if Str=nil then exit(false);
Result := (Str.Read(Buf, 2)=2) and (Buf[0]=$FF) and (Buf[1]=$D8); // byte sequence FFD8 = start of image
end;
constructor TFPReaderJPEG.Create;