summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-10-11 09:44:07 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-10-11 09:44:07 +0200
commita2ae86ddf52ac535d4cff4d698171c48e8aea7fe (patch)
tree8cc3907f139761bc99b4c063e2793b5d51c2cc07
parent0bad95fe5a8690564e6b096be62805fadc4fa0f6 (diff)
PhotoRec: fix .spe file recovery on big endian arch
-rw-r--r--src/file_spe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_spe.c b/src/file_spe.c
index 662a5be..eae09ce 100644
--- a/src/file_spe.c
+++ b/src/file_spe.c
@@ -253,7 +253,7 @@ static int header_check_spe(const unsigned char *buffer, const unsigned int buff
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_spe.extension;
file_recovery_new->min_filesize=4100;
- file_recovery_new->calculated_file_size=(uint64_t)le16(spe->xdim)*le16(spe->ydim)*le16(spe->NumFrames);
+ file_recovery_new->calculated_file_size=(uint64_t)le16(spe->xdim)*le16(spe->ydim)*le32(spe->NumFrames);
file_recovery_new->calculated_file_size*=(le16(spe->datatype)<=1?4:2);
file_recovery_new->calculated_file_size+=4100;
log_debug("spe xdim=%u ydim=%u NumFrames=%u datatype=%u size=%llu\n",