mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-22 02:44:38 +00:00
(file_extract) Fix invalid read in zlib_parse_file_progress()
This commit is contained in:
parent
3d011e0338
commit
f386c9b7f9
@ -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