Commit af599d51 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

ifo_read: use info_length as a size_t

This makes sense since it is used as a malloc' size.
And add a check in case it would have been negative
parent f0bcc87c
......@@ -1633,7 +1633,7 @@ int ifoRead_C_ADT(ifo_handle_t *ifofile) {
static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
c_adt_t *c_adt, unsigned int sector) {
int i, info_length;
size_t i, info_length;
if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN))
return 0;
......@@ -1644,6 +1644,9 @@ static int ifoRead_C_ADT_internal(ifo_handle_t *ifofile,
if(c_adt->last_byte + 1 < C_ADT_SIZE)
return 0;
info_length = c_adt->last_byte + 1 - C_ADT_SIZE;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment