mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
Merge pull request #2526 from heuripedes/master
(file_extract) Fix invalid read in zlib_parse_file_progress()
This commit is contained in:
commit
44d0cc109b
@ -606,10 +606,9 @@ bool zlib_parse_file(const char *file, const char *valid_exts,
|
||||
|
||||
int zlib_parse_file_progress(void *data)
|
||||
{
|
||||
/* FIXME: this estimate is pretty bad */
|
||||
/* FIXME: this estimate is worse than before */
|
||||
zlib_transfer_t *state = (zlib_transfer_t*)data;
|
||||
const uint8_t *offset = state->data + read_le(state->directory + 42, 4);
|
||||
ptrdiff_t delta = offset - state->data - 46 - 22;
|
||||
ptrdiff_t delta = state->directory - state->data;
|
||||
return delta * 100 / state->zip_size;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user