summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-06-22 19:25:39 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2018-06-22 19:25:39 +0200
commitedf52264ae9473ab8b7fa3ee6e2d53eb8f623ad9 (patch)
tree8885deeafd3a7bfaa7577fbcbce06328a1781ac6
parentb27f1916792ceed3eedfc2bc9121ddf43a165f6c (diff)
PhotoRec: sr2 files may violate some TIFF specifications
-rw-r--r--src/file_tiff.c2
-rw-r--r--src/file_tiff_le.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/file_tiff.c b/src/file_tiff.c
index 867678d..02d0bf7 100644
--- a/src/file_tiff.c
+++ b/src/file_tiff.c
@@ -182,7 +182,7 @@ void file_check_tiff(file_recovery_t *fr)
calculated_file_size=header_check_tiff_be(fr, be32(header.tiff_diroff), 0, 0);
#ifdef DEBUG_TIFF
log_info("TIFF Current %llu\n", (unsigned long long)fr->file_size);
- log_info("TIFF Estimated %llu\n", (unsigned long long)calculated_file_size);
+ log_info("TIFF Estimated %llu %llx\n", (unsigned long long)calculated_file_size, (unsigned long long)calculated_file_size);
#endif
if(fr->file_size < calculated_file_size || calculated_file_size==0)
fr->file_size=0;
diff --git a/src/file_tiff_le.c b/src/file_tiff_le.c
index 9ae9d60..71ada70 100644
--- a/src/file_tiff_le.c
+++ b/src/file_tiff_le.c
@@ -326,7 +326,7 @@ uint64_t header_check_tiff_le(file_recovery_t *fr, const uint32_t tiff_diroff, c
if(tdir_tag_old > tdir_tag)
{ /* Entries must be sorted by tag, some SR2 file doesn't respected this rule */
sorted_tag_error++;
- if(sorted_tag_error > 1)
+ if(sorted_tag_error > 1 && strcmp(fr->extension,"sr2")!=0)
return -1;
}
if(val>4)