Commit bf73f91d authored by Christoffer Ackelman's avatar Christoffer Ackelman

Fixed PBM loader, width/height was swapped...

parent 05b57d00
......@@ -680,7 +680,9 @@ static void loadPBM(const char *filename, PBM* img)
while (fgetc(f) != '\n')
;
int size = img->width * (img->height / 8 + 1);
// The number of bytes per row is width / 8 rounded upwards.
// So the total number of bytes is height * ceil(width / 8)
int size = img->height * (img->width / 8 + 1);
img->data = new unsigned char[size];
for (int i = 0; i < size; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment