Skip to content

Commit 16adab6

Browse files
victoryforceTurboGit
authored andcommitted
Allow out of spec DateTimeOriginal without trailing null byte
1 parent f526537 commit 16adab6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common/exif.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1138,9 +1138,12 @@ static void _find_datetime_taken(Exiv2::ExifData &exifData,
11381138
// Note: We allow a longer "datetime original" field with an unnecessary
11391139
// trailing byte(s) due to buggy software that creates it.
11401140
// See https://github.com/darktable-org/darktable/issues/17389
1141+
// We also accept the out of spec Exif.Photo.DateTimeOriginal
1142+
// without a null terminator, which AnalogExif creates.
1143+
// See https://github.com/darktable-org/darktable/issues/18146
11411144
if((FIND_EXIF_TAG("Exif.Image.DateTimeOriginal")
11421145
|| FIND_EXIF_TAG("Exif.Photo.DateTimeOriginal"))
1143-
&& pos->size() >= DT_DATETIME_EXIF_LENGTH)
1146+
&& pos->size() >= DT_DATETIME_EXIF_LENGTH - 1)
11441147
{
11451148
_strlcpy_to_utf8(exif_datetime_taken, DT_DATETIME_EXIF_LENGTH, pos, exifData);
11461149
if(FIND_EXIF_TAG("Exif.Photo.SubSecTimeOriginal")

0 commit comments

Comments
 (0)