Catch EOF faster in find_chunk

This commit is contained in:
bnnm 2020-06-06 16:12:20 +02:00
parent 2e7c4dc458
commit e5e0076f37

View File

@ -1190,6 +1190,9 @@ static int find_chunk_internal(STREAMFILE *streamFile, uint32_t chunk_id, off_t
uint32_t chunk_size = read_32bit_size(offset + 0x04,streamFile);
//;VGM_LOG("CHUNK: type=%x, size=%x at %lx\n", chunk_type, chunk_size, offset);
if (chunk_type == 0xFFFFFFFF || chunk_size == 0xFFFFFFFF)
return 0;
if (chunk_type == chunk_id) {
if (out_chunk_offset) *out_chunk_offset = offset + 0x08;
if (out_chunk_size) *out_chunk_size = chunk_size;