summaryrefslogtreecommitdiffstats
path: root/src/file_jpg.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-09-17 13:27:33 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2011-09-17 13:27:33 +0200
commitffef82b444c85aec1b36209165ec038124f44027 (patch)
tree0e5f2f08e6fea5ebd971c765e9284cd6d736f600 /src/file_jpg.c
parent0df6ef5b08f00c4d1b6030eb83a20eb109243d16 (diff)
PhotoRec: Some JPG have two APP1 markers, avoid to dicard the first one
Diffstat (limited to 'src/file_jpg.c')
-rw-r--r--src/file_jpg.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/file_jpg.c b/src/file_jpg.c
index 4cc1bc8..0c261e7 100644
--- a/src/file_jpg.c
+++ b/src/file_jpg.c
@@ -144,6 +144,15 @@ static int header_check_jpg(const unsigned char *buffer, const unsigned int buff
{
return 0;
}
+ /* Some JPG have two APP1 markers, avoid to dicard the first one */
+ if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ file_recovery->file_stat->file_hint==&file_hint_jpg &&
+ memcmp(buffer, jpg_header_app1, sizeof(jpg_header_app1))==0 &&
+ memcmp(&buffer[6], "http://ns.adobe.com/xap/", 24)==0)
+ {
+ return 0;
+ }
+
/* Don't extract jpg inside AVI */
if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_riff &&