summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-09-11 21:01:37 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-09-11 21:01:37 +0200
commit65543b032a3f3978f46add944c050d30e2d1a400 (patch)
treeadd01f05a8fdb7d5040718de68b03efce116edad /src
parent459910741707b88608fec5c8164a5c05c53528b7 (diff)
Add note about sr2 and arw TIFF files
Diffstat (limited to 'src')
-rw-r--r--src/file_tiff.h1
-rw-r--r--src/file_tiff_le.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/file_tiff.h b/src/file_tiff.h
index e91d02f..ed2f86c 100644
--- a/src/file_tiff.h
+++ b/src/file_tiff.h
@@ -38,6 +38,7 @@ extern "C" {
#define TIFFTAG_KODAKIFD 33424
#define TIFFTAG_EXIFIFD 34665
#define EXIFTAG_MAKERNOTE 37500 /* Manufacturer notes */
+#define TIFFTAG_SONY_FILEFORMAT 0xb000
#define TIFFTAG_IMAGEOFFSET 0xbcc0
#define TIFFTAG_IMAGEBYTECOUNT 0xbcc1
#define TIFFTAG_ALPHAOFFSET 0xbcc2
diff --git a/src/file_tiff_le.c b/src/file_tiff_le.c
index 31202a1..67b6d52 100644
--- a/src/file_tiff_le.c
+++ b/src/file_tiff_le.c
@@ -507,8 +507,11 @@ int header_check_tiff_le_new(const unsigned char *buffer, const unsigned int buf
{
const char *tag_make;
tag_make=find_tag_from_tiff_header_le(header, buffer_size, TIFFTAG_MAKE, &potential_error);
- if(tag_make!=NULL && tag_make >= (const char *)buffer && tag_make < (const char *)buffer + buffer_size - 20)
+ if(tag_make!=NULL && tag_make >= (const char *)buffer && tag_make < (const char *)buffer + buffer_size - 5)
{
+ /* TODO
+ * sr2 if Sony::FileFormat begins by 1
+ * arw otherwise */
if(strcmp(tag_make, "SONY")==0)
file_recovery_new->extension="sr2";
else if(strncmp(tag_make, "SONY ",5)==0)