/branches/dd/uspace/srv/fb/ppm.c |
---|
94,7 → 94,7 |
unsigned int coef; |
/* Read magic */ |
if (data[0] != 'P' || data[1] != '6') |
if ((data[0] != 'P') || (data[1] != '6')) |
return EINVAL; |
data+=2; |
106,9 → 106,9 |
read_num(&data,&maxcolor); |
data++; |
if (maxcolor == 0 || maxcolor > 255 || width * height > datasz) { |
if ((maxcolor == 0) || (maxcolor > 255) || (width * height > datasz)) |
return EINVAL; |
} |
coef = 255 / maxcolor; |
if (coef * maxcolor > 255) |
coef -= 1; |