New Paste :: Recent Pastes:: Add Line Numbers
crashy :( by baldurk
for(int i=0; i < width; i++) //for(int i=50; i < 55; i++) { fseek(fp, offset, SEEK_SET); fseek(fp, pointers[i], SEEK_CUR); // at first post of column int cnt = 0; unsigned char *column = new unsigned char[height*3], prevread = 0; cout << (void *)column << endl; memset(column, 0, height*3); while(prevread != (unsigned char)255) { fread(&prevread, sizeof(char), 1, fp); column[cnt++] = prevread; cout << (int)prevread << endl; } cout << "****ANALYSING****" << endl; cnt = 0; while(column[cnt] != (unsigned char)255) { unsigned char row = column[cnt++]; cout << "--- row " << (int)row << endl; unsigned char numpix = column[cnt++]; cnt++; // skip an irrelevant byte for(int j=0; j < (int)numpix; j++) { cout << "-> " << (int)column[cnt] << " " << i << " " << (int)row << " " << j << " " << i*width + row + j << endl; if(Data[i*width + row + j] != 254) { cout << "WOAH! OVERWRITING PICTURE CELLS! " << (int)Data[i*width + row + j] << endl; cnt++; } else Data[i*width + row + j] = column[cnt++]; } cnt++; // skip an irrelevant byte } cout << (int)column[cnt] << endl; cout << cnt << " " << height*3 << endl; cout << (void *)column << endl; delete[] column; cout << "****DONE ANALYSING****" << endl; } cout << "**********************" << endl;