Skip to content

Commit

Permalink
bugfix: fixed + 7 integer overflow in pnm_load_rawpbm; this fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Szabo committed Feb 27, 2018
1 parent 4737871 commit beea3bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion input-pnm.ci
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ pnm_load_rawpbm (PNMScanner *scan,

fd = pnmscanner_fd(scan);
/****pts****/ /* rowlen = (unsigned int)ceil((double)(info->xres)/8.0);*/
rowlen=(info->xres+7)>>3;
rowlen = (info->xres >> 3) + (info->xres & 3 ? 1 : 0);
/* buf = (unsigned char *)malloc(rowlen*sizeof(unsigned char)); */
XMALLOCT(buf, unsigned char*, rowlen*sizeof(unsigned char));

Expand Down

0 comments on commit beea3bd

Please sign in to comment.