summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-09-21 18:10:27 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-09-21 18:10:27 +0200
commit2cc3a1fd2bab0e805f110931ed012ea7ec18fb32 (patch)
tree29a74ce41d47a9f9d2a2198769de8a69cbf5ab9d
parentb75c2fca2a39cea956efff127c345c00e99486f0 (diff)
PhotoRec: force to uint64_t some calculated_file_size
-rw-r--r--src/file_abr.c4
-rw-r--r--src/file_aif.c4
-rw-r--r--src/file_au.c2
-rw-r--r--src/file_flp.c2
-rw-r--r--src/file_mb.c2
-rw-r--r--src/file_mrw.c2
-rw-r--r--src/file_ra.c4
7 files changed, 10 insertions, 10 deletions
diff --git a/src/file_abr.c b/src/file_abr.c
index a21d4bf..29aef9a 100644
--- a/src/file_abr.c
+++ b/src/file_abr.c
@@ -75,8 +75,8 @@ static int header_check_abr(const unsigned char *buffer, const unsigned int buff
}
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_abr.extension;
- file_recovery_new->min_filesize=4+12+be32(hdr->size);
- file_recovery_new->calculated_file_size=4+12+be32(hdr->size);
+ file_recovery_new->min_filesize=(uint64_t)4+12+be32(hdr->size);
+ file_recovery_new->calculated_file_size=(uint64_t)4+12+be32(hdr->size);
if(file_recovery_new->blocksize < 12)
return 1;
file_recovery_new->data_check=&data_check_abr;
diff --git a/src/file_aif.c b/src/file_aif.c
index 67e0423..5504f22 100644
--- a/src/file_aif.c
+++ b/src/file_aif.c
@@ -58,7 +58,7 @@ static int header_check_aif(const unsigned char *buffer, const unsigned int buff
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_aif.extension;
- file_recovery_new->calculated_file_size=be32(hdr->ckSize)+8;
+ file_recovery_new->calculated_file_size=(uint64_t)be32(hdr->ckSize)+8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
@@ -67,7 +67,7 @@ static int header_check_aif(const unsigned char *buffer, const unsigned int buff
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension="iff";
- file_recovery_new->calculated_file_size=be32(hdr->ckSize)+8;
+ file_recovery_new->calculated_file_size=(uint64_t)be32(hdr->ckSize)+8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
diff --git a/src/file_au.c b/src/file_au.c
index aa14361..bab248b 100644
--- a/src/file_au.c
+++ b/src/file_au.c
@@ -67,7 +67,7 @@ static int header_check_au(const unsigned char *buffer, const unsigned int buffe
reset_file_recovery(file_recovery_new);
file_recovery_new->min_filesize=111;
file_recovery_new->extension=file_hint_au.extension;
- file_recovery_new->calculated_file_size=be32(au->offset)+be32(au->size);
+ file_recovery_new->calculated_file_size=(uint64_t)be32(au->offset)+be32(au->size);
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
diff --git a/src/file_flp.c b/src/file_flp.c
index b67fd52..affebe4 100644
--- a/src/file_flp.c
+++ b/src/file_flp.c
@@ -63,7 +63,7 @@ static int header_check_flp(const unsigned char *buffer, const unsigned int buff
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_flp.extension;
- file_recovery_new->calculated_file_size=le32(hdr->len2) + 0x16;
+ file_recovery_new->calculated_file_size=(uint64_t)le32(hdr->len2) + 0x16;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
diff --git a/src/file_mb.c b/src/file_mb.c
index d7a579c..b730062 100644
--- a/src/file_mb.c
+++ b/src/file_mb.c
@@ -57,7 +57,7 @@ static int header_check_mb(const unsigned char *buffer, const unsigned int buffe
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mb.extension;
file_recovery_new->min_filesize=16;
- file_recovery_new->calculated_file_size=be32(hdr->size)+8;
+ file_recovery_new->calculated_file_size=(uint64_t)be32(hdr->size)+8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
diff --git a/src/file_mrw.c b/src/file_mrw.c
index 19c1d77..498c216 100644
--- a/src/file_mrw.c
+++ b/src/file_mrw.c
@@ -79,7 +79,7 @@ static int header_check_mrw(const unsigned char *buffer, const unsigned int buff
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mrw.extension;
- file_recovery_new->calculated_file_size= be32(mrmhdr->size)+ 8 +
+ file_recovery_new->calculated_file_size= (uint64_t)be32(mrmhdr->size)+ 8 +
((uint64_t)be16(prd->ccd.x) * be16(prd->ccd.y) * prd->datasize + 8 - 1) / 8;
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
diff --git a/src/file_ra.c b/src/file_ra.c
index 6c4ab7d..b1b6e90 100644
--- a/src/file_ra.c
+++ b/src/file_ra.c
@@ -87,7 +87,7 @@ static int header_check_ra(const unsigned char *buffer, const unsigned int buffe
const struct ra3_header *ra3=(const struct ra3_header *)buffer;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_ra.extension;
- file_recovery_new->calculated_file_size=8 + be16(ra3->header_size) + be32(ra3->data_size);
+ file_recovery_new->calculated_file_size=(uint64_t)8 + be16(ra3->header_size) + be32(ra3->data_size);
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;
@@ -98,7 +98,7 @@ static int header_check_ra(const unsigned char *buffer, const unsigned int buffe
const struct ra4_header *ra4=(const struct ra4_header *)buffer;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_ra.extension;
- file_recovery_new->calculated_file_size=40 + be16(ra4->header_size) + be32(ra4->data_size);
+ file_recovery_new->calculated_file_size=(uint64_t)40 + be16(ra4->header_size) + be32(ra4->data_size);
file_recovery_new->data_check=&data_check_size;
file_recovery_new->file_check=&file_check_size;
return 1;