diff options
author | Christophe Grenier <[email protected]> | 2019-05-01 11:59:02 +0200 |
---|---|---|
committer | Christophe Grenier <[email protected]> | 2019-05-01 11:59:02 +0200 |
commit | 9223789872cdf200030c93427d4a494eccee8d3b (patch) | |
tree | 409772f9f60f220aad7c5efb2586e2cf2f88bd16 | |
parent | e6280ccd1349f7ffea8972dfe48928935c3b0553 (diff) |
PhotoRec: avoid to split x3f file due to x3i signature
-rw-r--r-- | src/file_x3f.c | 8 | ||||
-rw-r--r-- | src/file_x3i.c | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/file_x3f.c b/src/file_x3f.c index 896ac1a9..0cba13ff 100644 --- a/src/file_x3f.c +++ b/src/file_x3f.c @@ -31,6 +31,7 @@ #include "filegen.h" #include "common.h" +extern const file_hint_t file_hint_x3i; static void register_header_check_x3f(file_stat_t *file_stat); static int header_check_x3f(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new); @@ -63,8 +64,15 @@ static int header_check_x3f(const unsigned char *buffer, const unsigned int buff return 0; if(rotation!=0 && rotation!=90 && rotation!=180 && rotation!=270) return 0; + if(file_recovery->file_stat!=NULL && + file_recovery->file_stat->file_hint==&file_hint_x3i && + safe_header_only==0) + { + return 0; + } reset_file_recovery(file_recovery_new); file_recovery_new->extension=file_hint_x3f.extension; + file_recovery_new->min_filesize=1024; return 1; } diff --git a/src/file_x3i.c b/src/file_x3i.c index b4b9b933..c1a001fb 100644 --- a/src/file_x3i.c +++ b/src/file_x3i.c @@ -45,6 +45,7 @@ static int header_check_x3i(const unsigned char *buffer, const unsigned int buff { reset_file_recovery(file_recovery_new); file_recovery_new->extension=file_hint_x3i.extension; + file_recovery_new->min_filesize=1024; return 1; } |