mirror of https://git.tukaani.org/xz.git
Fix uint32_t -> size_t in ARM and ARM-Thumb filters.
On 64-bit system it would have gone into infinite loop if a single input buffer was over 4 GiB (unlikely).
This commit is contained in:
parent
31decdce04
commit
e518d167aa
|
@ -19,7 +19,7 @@ arm_code(lzma_simple *simple lzma_attribute((unused)),
|
||||||
uint32_t now_pos, bool is_encoder,
|
uint32_t now_pos, bool is_encoder,
|
||||||
uint8_t *buffer, size_t size)
|
uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
size_t i;
|
||||||
for (i = 0; i + 4 <= size; i += 4) {
|
for (i = 0; i + 4 <= size; i += 4) {
|
||||||
if (buffer[i + 3] == 0xEB) {
|
if (buffer[i + 3] == 0xEB) {
|
||||||
uint32_t src = (buffer[i + 2] << 16)
|
uint32_t src = (buffer[i + 2] << 16)
|
||||||
|
|
|
@ -19,7 +19,7 @@ armthumb_code(lzma_simple *simple lzma_attribute((unused)),
|
||||||
uint32_t now_pos, bool is_encoder,
|
uint32_t now_pos, bool is_encoder,
|
||||||
uint8_t *buffer, size_t size)
|
uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
uint32_t i;
|
size_t i;
|
||||||
for (i = 0; i + 4 <= size; i += 2) {
|
for (i = 0; i + 4 <= size; i += 2) {
|
||||||
if ((buffer[i + 1] & 0xF8) == 0xF0
|
if ((buffer[i + 1] & 0xF8) == 0xF0
|
||||||
&& (buffer[i + 3] & 0xF8) == 0xF8) {
|
&& (buffer[i + 3] & 0xF8) == 0xF8) {
|
||||||
|
|
Loading…
Reference in New Issue