summaryrefslogtreecommitdiffstats
path: root/src/file_ogg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-03-10 16:13:52 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2013-03-10 16:13:52 +0100
commitf1cbfbbe9e14e145dd192cfd33062a4af907e805 (patch)
tree660ba6d462ba0312082e7bf9d5f3b3820f765f35 /src/file_ogg.c
parentc64a4ce0513753adb9ddda82e42b63d413728cc2 (diff)
PhotoRec: fix ogg recovery when blocksize=1
Diffstat (limited to 'src/file_ogg.c')
-rw-r--r--src/file_ogg.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/file_ogg.c b/src/file_ogg.c
index c87061d..ae2c09b 100644
--- a/src/file_ogg.c
+++ b/src/file_ogg.c
@@ -57,14 +57,18 @@ static int header_check_ogg(const unsigned char *buffer, const unsigned int buff
{
if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_ogg &&
- file_recovery->calculated_file_size == file_recovery->file_size)
+ (file_recovery->blocksize < (27+255)/2 ||
+ file_recovery->calculated_file_size == file_recovery->file_size))
return 0;
if(memcmp(buffer,ogg_header,sizeof(ogg_header))==0)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->calculated_file_size=0;
- file_recovery_new->data_check=&data_check_ogg;
- file_recovery_new->file_check=&file_check_size;
+ if(file_recovery_new->blocksize > (27+255)/2)
+ {
+ file_recovery_new->data_check=&data_check_ogg;
+ file_recovery_new->file_check=&file_check_size;
+ }
/* Ogg data, Theora video */
if(memcmp(&buffer[28], sign_theora, sizeof(sign_theora))==0)
file_recovery_new->extension="ogm";