As I explained previously in the wrong forum, I suspected a bug on the library.
Here it is (people who don't stand technical information, please don't read what is following !)
On the source file CapsImage.cpp of the CapsImage folder, line 404, I read :
Code: Select all
PUBYTE trackbuf = pti->trackdata[rev];
int tracklen = allrev ? pti->rawlen : pti->tracksize[rev];
Which is pti->tracksize[rev] for multiple rev, and meant to be rawlen if "allrev" is different from 0.
But....
Following, we have (line 420) :
Code: Select all
while (bofs < tracklen) {
// get actual byte from track buffer
uint8_t bval = trackbuf[bofs];
- allrev = 1
- rev = 1
In these case, the index buffer of the trackbuf would be : Index of first rev + bofs (which can be up to rawlen ) > rawlen.
I expected either tracklen to be equal to pti->tracksize[rev], OR trackbuf to be equal to pti->trackdata[0] in case of allrev...
I hope this make sense
This can lead to misunderstand of values (if lucky with read access of the buffer), or even some exceptions.
With the following correction on line 405 :
Code: Select all
int tracklen = pti->tracksize[rev];
Thomas