Changeset 76fca31 in mainline for uspace/srv/fb/ppm.c
- Timestamp:
- 2008-12-16T19:02:07Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5ae4443
- Parents:
- 8fe5980
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fb/ppm.c
r8fe5980 r76fca31 93 93 unsigned int color; 94 94 unsigned int coef; 95 95 96 96 /* Read magic */ 97 if ( data[0] != 'P' || data[1] != '6')97 if ((data[0] != 'P') || (data[1] != '6')) 98 98 return EINVAL; 99 100 data +=2;99 100 data += 2; 101 101 skip_whitespace(&data); 102 102 read_num(&data, &width); 103 103 skip_whitespace(&data); 104 read_num(&data, &height);104 read_num(&data, &height); 105 105 skip_whitespace(&data); 106 read_num(&data, &maxcolor);106 read_num(&data, &maxcolor); 107 107 data++; 108 109 if ( maxcolor == 0 || maxcolor > 255 || width * height > datasz) {108 109 if ((maxcolor == 0) || (maxcolor > 255) || (width * height > datasz)) 110 110 return EINVAL; 111 }111 112 112 coef = 255 / maxcolor; 113 113 if (coef * maxcolor > 255) … … 126 126 data += 3; 127 127 } 128 128 129 129 return 0; 130 130 }
Note:
See TracChangeset
for help on using the changeset viewer.