From 0d703fb4538b7c7be275dd80d8a3c31845908f2b Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 17 Jan 2021 11:10:46 +0000 Subject: [PATCH] fpExif: Fix crash in images of YUNEEC CGO3 camera due to empty IFD entries. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7964 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpexif/fpeexifreadwrite.pas | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/fpexif/fpeexifreadwrite.pas b/components/fpexif/fpeexifreadwrite.pas index 00550dee7..fb4ad9b43 100644 --- a/components/fpexif/fpeexifreadwrite.pas +++ b/components/fpexif/fpeexifreadwrite.pas @@ -331,6 +331,13 @@ begin exit; end; + if (ifdRec.TagID = 0) and (ifdRec.DataType = 0) and (ifdRec.DataCount = 0) and (ifdRec.DataValue = 0) then + begin + // This is an empty IFD entry as found in images of the YUNEEC CGO3 camera + AStream.Position := AStream.Position + n; + Continue; + end; + ifdRec.TagID := FixEndian16(ifdRec.TagID); ifdRec.DataType := FixEndian16(ifdRec.DataType); if not (ifdRec.DataType in [1..ord(High(TTagType))]) then begin