sec2msf(sector + 2 * 75, (char *)&cdbuffer[12]);
cdbuffer[12 + 3] = 1;
- return ret;
+ return 12*2 + ret;
}
static unsigned char * CALLBACK ISOgetBuffer_compr(void) {
}
ret = cdimg_read_func(cdHandle, 0, cdbuffer, sector);
- if (ret < 0)
+ if (ret < 12*2 + 2048)
return 0;
if (subHandle != NULL) {
CDR_LOG("ReadTrack *** %02x:%02x:%02x\n", tmp[0], tmp[1], tmp[2]);
read_ok = CDR_readTrack(tmp);
- memcpy(cdr.Prev, tmp, 3);
+ if (read_ok)
+ memcpy(cdr.Prev, tmp, 3);
if (CheckSBI(time))
return read_ok;
if (!read_ok) {
CDR_LOG_I("cdrReadInterrupt() Log: err\n");
- memset(cdr.Transfer, 0, DATA_SIZE);
cdrReadInterruptSetResult(cdr.StatP | STATUS_ERROR);
return;
}