fpexif: Write NULL byte after string tags.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6869 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-04-26 10:15:13 +00:00
parent efd629624c
commit 0d39fd7dfd

View File

@@ -1501,6 +1501,8 @@ begin
SetLength(sa, Length(FRawData));
Move(FRawData[0], sa[1], Length(FRawData));
// Remove NULL byte
while (sa <> '') and (sa[Length(sa)] = #0) do
Delete(sa, Length(sa), 1);
@@ -1520,9 +1522,10 @@ begin
end else
begin
sa := ansistring(AValue);
FCount := Length(sa);
FCount := Length(sa) + 1; // +1 for NULL byte required by EXIF specification
SetLength(FRawData, FCount);
Move(sa[1], FRawData[0], FCount);
FRawData[FCount-1] := 0; // Write NULL byte required by EXIF specification
end;
end;