summaryrefslogtreecommitdiffstats
path: root/src/file_ogg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-08-18 09:04:57 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2009-08-18 09:04:57 +0200
commit4cacfdab26e7490f38583ffe3f7a234ceda572dd (patch)
treeb64ee617bac4e914dc0f2c14905c3fea0170c38b /src/file_ogg.c
parent34a54690b3acf4cebbddd7f988e153043c8f5e8f (diff)
PhotoRec: identify Ogg data/Theora video .ogm files
Diffstat (limited to 'src/file_ogg.c')
-rw-r--r--src/file_ogg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/file_ogg.c b/src/file_ogg.c
index 8207330..c87061d 100644
--- a/src/file_ogg.c
+++ b/src/file_ogg.c
@@ -46,6 +46,7 @@ const file_hint_t file_hint_ogg= {
};
static const unsigned char ogg_header[4]= {'O','g','g','S'};
+static const unsigned char sign_theora[7]= {0x80, 't', 'h', 'e', 'o', 'r', 'a'};
static void register_header_check_ogg(file_stat_t *file_stat)
{
@@ -64,7 +65,11 @@ static int header_check_ogg(const unsigned char *buffer, const unsigned int buff
file_recovery_new->calculated_file_size=0;
file_recovery_new->data_check=&data_check_ogg;
file_recovery_new->file_check=&file_check_size;
- file_recovery_new->extension=file_hint_ogg.extension;
+ /* Ogg data, Theora video */
+ if(memcmp(&buffer[28], sign_theora, sizeof(sign_theora))==0)
+ file_recovery_new->extension="ogm";
+ else
+ file_recovery_new->extension=file_hint_ogg.extension;
return 1;
}
return 0;