summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-01-05 07:55:58 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-01-05 07:55:58 +0100
commit7715db0b6089b072ea96ced32c205b786b7e7a86 (patch)
tree8b137319ac414a94623e402d5bf1b380886a2a4b /src
parenta726786cc76bd89237756fc2d7cc6e6099c6e517 (diff)
PhotoRec: allows atom size up to 2GB
Diffstat (limited to 'src')
-rw-r--r--src/file_mov.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/file_mov.c b/src/file_mov.c
index cc06659..7d75207 100644
--- a/src/file_mov.c
+++ b/src/file_mov.c
@@ -78,9 +78,8 @@ static int header_check_mov(const unsigned char *buffer, const unsigned int buff
}
while(i<buffer_size-8)
{
- unsigned int atom_size;
- atom_size=(buffer[i+0]<<24)+(buffer[i+1]<<16)+(buffer[i+2]<<8)+buffer[i+3];
- if(atom_size<8 || atom_size>1024*1024*1024)
+ const unsigned int atom_size=(buffer[i+0]<<24)+(buffer[i+1]<<16)+(buffer[i+2]<<8)+buffer[i+3];
+ if(atom_size<8 || atom_size > (unsigned int)2*1024*1024*1024)
return 0;
/* check for commun atom type */
if(buffer[i+4]=='p' && buffer[i+5]=='n' && buffer[i+6]=='o' && buffer[i+7]=='t')