mirror of
https://github.com/intel/isa-l.git
synced 2024-12-13 09:52:56 +01:00
igzip: Fix bug in create_rand_repeat_data
Change-Id: Ib3ab731ea9a96cdbd0380d6a88b3837ae0de0815 Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
This commit is contained in:
parent
054758ea63
commit
a778455448
@ -182,8 +182,10 @@ void create_rand_repeat_data(uint8_t * data, int size)
|
||||
|
||||
max_repeat_data += power_of_2_array[power];
|
||||
|
||||
if (size-- > 0)
|
||||
if (size > 0) {
|
||||
size--;
|
||||
*data++ = rand();
|
||||
}
|
||||
|
||||
while (size > 0) {
|
||||
next_data = rand() % max_repeat_data;
|
||||
@ -208,8 +210,10 @@ void create_rand_repeat_data(uint8_t * data, int size)
|
||||
*data = *(data - distance);
|
||||
data++;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
memcpy(data, data - distance, length);
|
||||
data += length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user