summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobi <robi>2010-12-12 19:40:34 +0000
committerrobi <robi>2010-12-12 19:40:34 +0000
commitf9ee529a7268770c6a6e2b1ff9965821f434c67b (patch)
tree9f13cefca1056fb3eb90dc443b846922c01c9c4a
parentf12985cd14d462fe12ba474745a0967a82f3c2a5 (diff)
small changes tiff() and pnm()
-rw-r--r--src/file_type.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/file_type.c b/src/file_type.c
index 74b6f48..746afd4 100644
--- a/src/file_type.c
+++ b/src/file_type.c
@@ -1469,7 +1469,7 @@ int file_psd(unsigned char *buf, int *size, __u32 scan , int flag, struct found_
//pnm
int file_pnm(unsigned char *buf, int *size, __u32 scan , int flag, struct found_data_t* f_data){
- int x,y,d;
+ int x,y,d,s ;
unsigned char *c, *txt;
__u32 ssize = 0;
int ret = 0;
@@ -1499,8 +1499,16 @@ case 2:
c++;
txt = c + 1;
while (isspace(*txt)) txt++;
- if (*txt == '#'){
- while (!isspace(*txt)) txt++;
+ while (*txt == '#'){
+ s = 0;
+ while ((*txt != 0x0a) && (*txt != 0x0d) && (s < 70)){
+ txt++;
+ s++;
+ }
+ if (s == 70) {
+ f_data->func = file_none;
+ return 0;
+ }
while (isspace(*txt)) txt++;
}
x=atoi(txt);
@@ -1571,8 +1579,10 @@ int file_tiff(unsigned char *buf, int *size, __u32 scan , int flag, struct found
case 0 :
if (f_data->size ){
if ((f_data->inode->i_size > f_data->size) && (*size < (current_fs->blocksize -8))){ //FIXME
- *size += 8;
ret = 4;
+ if (*size < (current_fs->blocksize - 256))
+ ret = 1;
+ *size += 8;
}
}
else{