PhotoRec: better file check for gif files
This commit is contained in:
parent
cd5f3bea4c
commit
d02591d45c
1 changed files with 9 additions and 1 deletions
|
@ -83,7 +83,15 @@ static int header_check_gif(const unsigned char *buffer, const unsigned int buff
|
||||||
static void file_check_gif(file_recovery_t *file_recovery)
|
static void file_check_gif(file_recovery_t *file_recovery)
|
||||||
{
|
{
|
||||||
const unsigned char gif_footer[2]= {0x00, 0x3b};
|
const unsigned char gif_footer[2]= {0x00, 0x3b};
|
||||||
file_search_footer(file_recovery, gif_footer, sizeof(gif_footer), 0);
|
unsigned char buffer[2];
|
||||||
|
if(fseek(file_recovery->handle, file_recovery->calculated_file_size-2, SEEK_SET)<0 ||
|
||||||
|
fread(buffer, 2, 1, file_recovery->handle)!=1 ||
|
||||||
|
memcmp(buffer, gif_footer, sizeof(gif_footer))!=0)
|
||||||
|
{
|
||||||
|
file_recovery->file_size=0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
file_recovery->file_size=file_recovery->calculated_file_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static data_check_t data_check_gif(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
|
static data_check_t data_check_gif(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
|
||||||
|
|
Loading…
Reference in a new issue