mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Remove code in tracks block interpreter that was doing nothing util but corrupting the heap.
This commit is contained in:
25
src/open.c
25
src/open.c
@@ -39,7 +39,6 @@ void* aaruf_open(const char* filepath)
|
|||||||
uint8_t* data;
|
uint8_t* data;
|
||||||
uint32_t* cdDdt;
|
uint32_t* cdDdt;
|
||||||
uint64_t crc64;
|
uint64_t crc64;
|
||||||
uint8_t temp8u;
|
|
||||||
int i, j;
|
int i, j;
|
||||||
uint16_t e;
|
uint16_t e;
|
||||||
|
|
||||||
@@ -791,28 +790,10 @@ void* aaruf_open(const char* filepath)
|
|||||||
|
|
||||||
ctx->numberOfDataTracks = 0;
|
ctx->numberOfDataTracks = 0;
|
||||||
|
|
||||||
// TODO: Handle track 0
|
for(j = 0; j < ctx->tracksHeader.entries; j++)
|
||||||
for(j = 0, temp8u = 0; j < ctx->tracksHeader.entries; j++)
|
|
||||||
{
|
{
|
||||||
if(ctx->trackEntries[j].sequence > temp8u && ctx->trackEntries[j].sequence <= 99)
|
if(ctx->trackEntries[j].sequence <= 99 && ctx->trackEntries[j].type != Audio)
|
||||||
temp8u = ctx->trackEntries[j].sequence;
|
ctx->numberOfDataTracks++;
|
||||||
}
|
|
||||||
|
|
||||||
if(temp8u > 0)
|
|
||||||
{
|
|
||||||
ctx->dataTracks = (TrackEntry*)malloc(sizeof(TrackEntry) * temp8u);
|
|
||||||
|
|
||||||
if(ctx->dataTracks == NULL) break;
|
|
||||||
|
|
||||||
ctx->numberOfDataTracks = temp8u;
|
|
||||||
|
|
||||||
for(j = 0, temp8u = 0; j < ctx->tracksHeader.entries; j++)
|
|
||||||
{
|
|
||||||
if(ctx->trackEntries[j].sequence > 99) continue;
|
|
||||||
|
|
||||||
memcpy(
|
|
||||||
&ctx->dataTracks[ctx->trackEntries[j].sequence], &ctx->trackEntries[j], sizeof(TrackEntry));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user