From a40e5a6ab92a6b6cdaf1fbe2aaa1703949e65c8a Mon Sep 17 00:00:00 2001 From: Christophe Grenier <grenier@cgsecurity.org> Date: Sat, 26 Jul 2014 22:32:55 +0200 Subject: [PATCH] PhotoRec: disable data check of .psd files for small blocksize --- src/file_psd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/file_psd.c b/src/file_psd.c index 7d85d0df..70cd50a0 100644 --- a/src/file_psd.c +++ b/src/file_psd.c @@ -36,7 +36,6 @@ #endif static void register_header_check_psd(file_stat_t *file_stat); -static int header_check_psd(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new); static data_check_t psd_skip_color_mode(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery); static void file_check_psd(file_recovery_t *file_recovery); @@ -69,6 +68,8 @@ static int header_check_psd(const unsigned char *buffer, const unsigned int buff reset_file_recovery(file_recovery_new); file_recovery_new->min_filesize=70; file_recovery_new->extension=file_hint_psd.extension; + if(file_recovery_new->blocksize < 16) + return 1; /* File header */ file_recovery_new->calculated_file_size=0x1a; file_recovery_new->data_check=&psd_skip_color_mode;