summaryrefslogtreecommitdiffstats
path: root/src/file_ogg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-08-09 09:45:24 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-08-09 09:45:24 +0200
commit0f0e96117be45b011b4a445cd61b88a05c291cb5 (patch)
tree22150cee2cf6683467c21202b10012f61f4e7fc6 /src/file_ogg.c
parentf719dd169330ed5a977ae371a6338425d85d6167 (diff)
PhotoRec: better check for ogm/ogv/ogg extension detection
Diffstat (limited to 'src/file_ogg.c')
-rw-r--r--src/file_ogg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/file_ogg.c b/src/file_ogg.c
index 047f27c..7893bbb 100644
--- a/src/file_ogg.c
+++ b/src/file_ogg.c
@@ -55,18 +55,20 @@ static int header_check_ogg(const unsigned char *buffer, const unsigned int buff
if((buffer[5]&0x02)!=0x02 &&
file_recovery!=NULL && file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_ogg &&
- (file_recovery->blocksize < (27+255)/2 ||
+ (file_recovery->blocksize < 27+255 ||
file_recovery->calculated_file_size == file_recovery->file_size))
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->calculated_file_size=0;
- if(file_recovery_new->blocksize > (27+255)/2)
+ if(file_recovery_new->blocksize > 27+255)
{
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";
+ else if(memcmp(&buffer[0x78], sign_theora, sizeof(sign_theora))==0)
file_recovery_new->extension="ogv";
else
file_recovery_new->extension=file_hint_ogg.extension;