summaryrefslogtreecommitdiffstats
path: root/src/file_mid.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_mid.c
parent65543b032a3f3978f46add944c050d30e2d1a400 (diff)
PhotoRec: avoid potential endless loops
Diffstat (limited to 'src/file_mid.c')
-rw-r--r--src/file_mid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/file_mid.c b/src/file_mid.c
index 06d82de..c7f8255 100644
--- a/src/file_mid.c
+++ b/src/file_mid.c
@@ -76,7 +76,7 @@ static void file_check_midi(file_recovery_t *file_recovery)
fread(&track, 8, 1, file_recovery->handle) != 1 ||
memcmp(&track.magic[0], "MTrk", 4)!=0)
return ;
- fs+=8+be32(track.len);
+ fs+=(uint64_t)8+be32(track.len);
}
if(fs_org < fs)
return ;
@@ -96,7 +96,7 @@ static data_check_t data_check_midi(const unsigned char *buffer, const unsigned
#endif
if(memcmp(&hdr->magic[0], "MTrk", 4)!=0)
return DC_STOP;
- file_recovery->calculated_file_size+=len+8;
+ file_recovery->calculated_file_size+=(uint64_t)8+len;
}
return DC_CONTINUE;
}