summaryrefslogtreecommitdiffstats
path: root/src/file_fits.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-03-12 13:15:40 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2014-03-12 13:15:40 +0100
commit9dd22eb3f07136d456ac5ca7f90c23d07b07c25b (patch)
tree6591b7e356558d6aaa69061bcc45511bcac572e2 /src/file_fits.c
parent682a7e810887ca1809b334b6242d0cf1ac7d50f6 (diff)
PhotoRec: some data_check_() were stopping too late
Diffstat (limited to 'src/file_fits.c')
-rw-r--r--src/file_fits.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/file_fits.c b/src/file_fits.c
index e177b73..404c8bf 100644
--- a/src/file_fits.c
+++ b/src/file_fits.c
@@ -146,11 +146,8 @@ static data_check_t data_check_fits(const unsigned char *buffer, const unsigned
file_recovery->calculated_file_size+=(i-i_org+2880-1)/2880*2880+(tmp+2880-1)/2880*2880;
}
}
- if(file_recovery->file_size>=file_recovery->calculated_file_size)
- {
- file_recovery->file_size=file_recovery->calculated_file_size;
+ if(file_recovery->file_size + buffer_size/2 >= file_recovery->calculated_file_size)
return DC_STOP;
- }
return DC_CONTINUE;
}