summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/file_fits.c5
-rw-r--r--src/file_qbb.c2
-rw-r--r--src/filegen.c3
3 files changed, 3 insertions, 7 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;
}
diff --git a/src/file_qbb.c b/src/file_qbb.c
index 8ee4794..d387e07 100644
--- a/src/file_qbb.c
+++ b/src/file_qbb.c
@@ -93,7 +93,7 @@ static int header_check_qbb(const unsigned char *buffer, const unsigned int buff
static data_check_t data_check_qbb(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
- if(file_recovery->file_size > file_recovery->calculated_file_size+512)
+ if(file_recovery->file_size + buffer_size / 2 > file_recovery->calculated_file_size+512)
{
return DC_STOP;
}
diff --git a/src/filegen.c b/src/filegen.c
index d409876..95fbd0f 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -275,9 +275,8 @@ void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*f
data_check_t data_check_size(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
- if(file_recovery->file_size>=file_recovery->calculated_file_size)
+ if(file_recovery->file_size + buffer_size/2 >= file_recovery->calculated_file_size)
{
- file_recovery->file_size=file_recovery->calculated_file_size;
return DC_STOP;
}
return DC_CONTINUE;