summaryrefslogtreecommitdiffstats
path: root/src/file_dv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-09-03 08:04:04 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-09-03 08:04:04 +0200
commit00557961744f0a88000678db179a84a4a0e4fdfd (patch)
treedb0bae677a788104fa71edaebcbfa30402833179 /src/file_dv.c
parentac980c4a61e0158ce5ceec8555a89b38eac5066c (diff)
PhotoRec: reduce the number of backward search
Diffstat (limited to 'src/file_dv.c')
-rw-r--r--src/file_dv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/file_dv.c b/src/file_dv.c
index ac8de0f..e44b859 100644
--- a/src/file_dv.c
+++ b/src/file_dv.c
@@ -136,11 +136,14 @@ static void file_check_dv_PAL(file_recovery_t *fr)
static int header_check_dv(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)
{
+ if(buffer[0]!=0x1f || buffer[1]!=0x07 || buffer[2]!=0x00 || buffer[5]!=0x78 || buffer[6]!=0x78 || buffer[7]!=0x78)
+ return 0;
if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_dv)
+ {
+ header_ignored(file_recovery_new);
return 0;
- if(buffer[0]!=0x1f || buffer[1]!=0x07 || buffer[2]!=0x00 || buffer[5]!=0x78 || buffer[6]!=0x78 || buffer[7]!=0x78)
- return 0;
+ }
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_dv.extension;
if((buffer[3]&0x80)==0)