summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-05-01 18:39:48 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-05-01 18:39:48 +0200
commitdbb605a251914b68a0d6b1603dd515e2c767d3b7 (patch)
treee95472ca892782deb5f1d6f2c78896f4372b5b41 /src
parent4fcebd8d05fc1ca4492588185b706e1a7a4224d8 (diff)
PhotoRec: Reject more invalid TIFF files
Diffstat (limited to 'src')
-rw-r--r--src/file_tiff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_tiff.c b/src/file_tiff.c
index 6b255c1..0c84c6f 100644
--- a/src/file_tiff.c
+++ b/src/file_tiff.c
@@ -48,7 +48,7 @@ const file_hint_t file_hint_tiff= {
.extension="tif",
.description="Tag Image File Format and some raw file formats (pef/nef/dcr/sr2/cr2)",
.min_header_distance=0,
- .max_filesize=PHOTOREC_MAX_FILE_SIZE,
+ .max_filesize=100*1024*1024,
.recover=1,
.enable_by_default=1,
.register_header_check=&register_header_check_tiff
@@ -945,7 +945,7 @@ void file_check_tiff(file_recovery_t *fr)
log_info("TIFF Current %llu\n", (unsigned long long)fr->file_size);
log_info("TIFF Estimated %llu\n", (unsigned long long)calculated_file_size);
#endif
- if(fr->file_size < calculated_file_size)
+ if(fr->file_size < calculated_file_size || calculated_file_size==0)
fr->file_size=0;
/* PhotoRec isn't yet capable to find the correct filesize for
* Sony arw and dng,