mirror of
https://github.com/intel/isa-l.git
synced 2025-01-06 07:01:09 +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];
|
max_repeat_data += power_of_2_array[power];
|
||||||
|
|
||||||
if (size-- > 0)
|
if (size > 0) {
|
||||||
|
size--;
|
||||||
*data++ = rand();
|
*data++ = rand();
|
||||||
|
}
|
||||||
|
|
||||||
while (size > 0) {
|
while (size > 0) {
|
||||||
next_data = rand() % max_repeat_data;
|
next_data = rand() % max_repeat_data;
|
||||||
@ -208,8 +210,10 @@ void create_rand_repeat_data(uint8_t * data, int size)
|
|||||||
*data = *(data - distance);
|
*data = *(data - distance);
|
||||||
data++;
|
data++;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
memcpy(data, data - distance, length);
|
memcpy(data, data - distance, length);
|
||||||
|
data += length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user