fpexif: Fix potential divide-by-zero error in TExposureTimeTag.GetAsString (https://forum.lazarus.freepascal.org/index.php/topic,44015.msg379681.html#msg379681).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7779 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz 2020-10-14 19:11:04 +00:00
parent 660f4a7db7
commit f25070ba4f

View File

@ -1510,10 +1510,11 @@ var
p: Integer;
begin
floatVal := GetAsFloat;
if IsNaN(floatVal) or (floatVal = 0) then
Result := ''
else
if FFormatStr = '' then begin
if IsNaN(floatVal) then
Result := ''
else if floatVal >= 10 then
if floatVal >= 10 then
Result := Format('%.0fs', [floatVal])
else if floatVal >= 1 then
Result := Format('%.1fs', [floatVal])