Commit 0c09c3f5 authored by npzacs's avatar npzacs

Simplify alloc size calculation

parent 0fbb8c9a
Pipeline #20424 passed with stage
in 1 minute and 14 seconds
......@@ -506,7 +506,7 @@ static size_t _read_mkb_file(AACS *aacs, const char *file, void **pdata)
size += read_size;
chunk_size = MKINT_BE24(data + size - 4 + 1);
if (data_size < size + chunk_size) {
for ( ; data_size < size + chunk_size; data_size *= 2) ;
data_size = 2*size + chunk_size;
void *tmp = realloc(data, data_size);
if (!tmp) {
X_FREE(data);
......
Markdown is supported
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