summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-05-01 11:59:02 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2019-05-01 11:59:02 +0200
commit9223789872cdf200030c93427d4a494eccee8d3b (patch)
tree409772f9f60f220aad7c5efb2586e2cf2f88bd16 /src
parente6280ccd1349f7ffea8972dfe48928935c3b0553 (diff)
PhotoRec: avoid to split x3f file due to x3i signature
Diffstat (limited to 'src')
-rw-r--r--src/file_x3f.c8
-rw-r--r--src/file_x3i.c1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/file_x3f.c b/src/file_x3f.c
index 896ac1a..0cba13f 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 b4b9b93..c1a001f 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;
}