summaryrefslogtreecommitdiffstats
path: root/src/file_wv.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2017-09-12 13:16:15 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2017-09-12 13:16:15 +0200
commitb75c2fca2a39cea956efff127c345c00e99486f0 (patch)
treede23d458cffe11c9568621c64b4815291fe3f0ba /src/file_wv.c
parent65543b032a3f3978f46add944c050d30e2d1a400 (diff)
PhotoRec: avoid potential endless loops
Diffstat (limited to 'src/file_wv.c')
-rw-r--r--src/file_wv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/file_wv.c b/src/file_wv.c
index 63b60eb..a061cff 100644
--- a/src/file_wv.c
+++ b/src/file_wv.c
@@ -89,7 +89,7 @@ static data_check_t data_check_wv(const unsigned char *buffer, const unsigned in
const WavpackHeader *wv=(const WavpackHeader*)&buffer[i];
if(memcmp(wv, wv_header, sizeof(wv_header))==0)
{
- file_recovery->calculated_file_size+=le32(wv->ckSize)+8;
+ file_recovery->calculated_file_size+=(uint64_t)8+le32(wv->ckSize);
}
else if(buffer[i]=='A' && buffer[i+1]=='P' && buffer[i+2]=='E' && buffer[i+3]=='T' && buffer[i+4]=='A' && buffer[i+5]=='G' && buffer[i+6]=='E' && buffer[i+7]=='X')
{ /* APE Tagv2 (APE Tagv1 has no header) http://wiki.hydrogenaudio.org/index.php?title=APE_Tags_Header */