Fix serious bugs related with El-Torito.

This commit is contained in:
Vreixo Formoso
2008-02-09 19:05:24 +01:00
parent 02814b0ff7
commit 9a70496d3c
3 changed files with 13 additions and 5 deletions

View File

@ -284,8 +284,13 @@ int mem_read(IsoStream *stream, void *buf, size_t count)
return ISO_FILE_NOT_OPENNED;
}
if (data->offset >= data->size) {
return 0; /* EOF */
}
len = MIN(count, data->size - data->offset);
memcpy(buf, data->buf + data->offset, len);
data->offset += len;
return len;
}