From 1734dbdcd9db596cd87347794672420fbf97609e Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Fri, 21 May 2010 09:03:36 +0200 Subject: [PATCH] PhotoRec: stricter check for .pcx --- src/file_pcx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/file_pcx.c b/src/file_pcx.c index 1878f0a1..7eff9e62 100644 --- a/src/file_pcx.c +++ b/src/file_pcx.c @@ -94,8 +94,9 @@ static int header_check_pcx(const unsigned char *buffer, const unsigned int buff pcx->Reserved==0 && le16(pcx->XMin) <= le16(pcx->XMax) && le16(pcx->YMin) <= le16(pcx->YMax) && - pcx->BytesPerLine>0 && - pcx->Filler[0]==0) + pcx->BytesPerLine>0 && pcx->BytesPerLine%2==0 && + pcx->Filler[0]==0 && pcx->Filler[1]==0 && + pcx->Filler[54]==0 && pcx->Filler[55]==0) { reset_file_recovery(file_recovery_new); #ifdef DEBUG_PCX