* Applied patch from Mattias Gaertner, fixing bug ID

git-svn-id: trunk@31942 -
This commit is contained in:
michael 2015-10-04 08:56:45 +00:00
parent aa3a7b7eb8
commit 94ff51c67e

View File

@ -1486,11 +1486,20 @@ begin
if EntryType<>2 then
TiffError('asciiz expected, but found '+IntToStr(EntryType));
EntryCount:=ReadDWord;
EntryStart:=ReadDWord;
SetStreamPos(EntryStart);
SetLength(Result,EntryCount-1);
if EntryCount>1 then
if EntryCount>4 then begin
// long string -> next 4 DWord is the offset
EntryStart:=ReadDWord;
SetStreamPos(EntryStart);
s.Read(Result[1],EntryCount-1);
end else begin
// short string -> stored directly in the next 4 bytes
if Result<>'' then
s.Read(Result[1],length(Result));
// skip rest of 4 bytes
if length(Result)<4 then
s.Read(EntryStart,4-length(Result));
end;
end;
function TFPReaderTiff.ReadByte: Byte;