From 626d38fcd0464b96f3f01b9e7e37e8274d57ce51 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Fri, 3 Mar 2017 07:00:53 +0100 Subject: [PATCH] PhotoRec: do not search text files when another file is recovered except if it's also a text file --- src/file_txt.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/file_txt.c b/src/file_txt.c index faaaf1f8..5e9adef6 100644 --- a/src/file_txt.c +++ b/src/file_txt.c @@ -1108,32 +1108,12 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff } if(file_recovery->file_stat!=NULL) { - if(file_recovery->file_stat->file_hint == &file_hint_doc) - { - return 0; - } - else if(file_recovery->file_stat->file_hint == &file_hint_fasttxt || + if(file_recovery->file_stat->file_hint == &file_hint_fasttxt || file_recovery->file_stat->file_hint == &file_hint_txt) { if(strstr(file_recovery->filename,".html")==NULL) return 0; } - else if(file_recovery->file_stat->file_hint == &file_hint_jpg) - { - /* Don't search text at the beginning of JPG */ - if(file_recovery->file_size < file_recovery->min_filesize) - return 0; - /* Text should not be found in JPEG */ - if(td_memmem(buffer, buffer_size_test, "8BIM", 4)!=NULL || - td_memmem(buffer, buffer_size_test, "adobe", 5)!=NULL || - td_memmem(buffer, buffer_size_test, "exif:", 5)!=NULL || - td_memmem(buffer, buffer_size_test, "", 6)!=NULL || - td_memmem(buffer, buffer_size_test, "xmp:CreatorTool>", 16)!=NULL || - td_memmem(buffer, buffer_size_test, "[camera info]", 13)!=NULL) - return 0; - } else return 0; }