diff --git a/src/file_gif.c b/src/file_gif.c index 28520bf5..db02812e 100644 --- a/src/file_gif.c +++ b/src/file_gif.c @@ -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) { 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)