summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:23:20 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2012-09-10 22:23:20 +0200
commit07b57a9ef738694d5b021473ba38b9f0103b2c11 (patch)
tree0f9ce99510444a7d17f689d47a7f5e7c1812d2a9 /src
parent0a869af4d3a1fbf96a9ad33b1a040817a7df1331 (diff)
PhotoRec: don't return date for year 0000
Diffstat (limited to 'src')
-rw-r--r--src/file_tiff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/file_tiff.c b/src/file_tiff.c
index 0c84c6f..b6fbb6d 100644
--- a/src/file_tiff.c
+++ b/src/file_tiff.c
@@ -281,6 +281,8 @@ time_t get_date_from_tiff_header(const TIFFHeader *tiff, const unsigned int tiff
date_asc=find_tag_from_tiff_header(tiff, tiff_size, 0x132, &potential_error);
if(date_asc==NULL || date_asc < (const char *)tiff || &date_asc[18] >= (const char *)tiff + tiff_size)
return (time_t)0;
+ if(memcmp(date_asc, "0000", 4)==0)
+ return (time_t)0;
memset(&tm_time, 0, sizeof(tm_time));
tm_time.tm_sec=(date_asc[17]-'0')*10+(date_asc[18]-'0'); /* seconds 0-59 */
tm_time.tm_min=(date_asc[14]-'0')*10+(date_asc[15]-'0'); /* minutes 0-59 */