diff options
Diffstat (limited to 'libarchive/archive_read_support_format_cab.c')
-rw-r--r-- | libarchive/archive_read_support_format_cab.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c index 975aca46..01da222c 100644 --- a/libarchive/archive_read_support_format_cab.c +++ b/libarchive/archive_read_support_format_cab.c @@ -2254,13 +2254,14 @@ lzx_br_fillup(struct lzx_stream *strm, struct lzx_br *br) case 4: if (strm->avail_in >= 8) { br->cache_buffer = - (((uint64_t)archive_le16dec( - strm->next_in)) << 48) | - (((uint64_t)archive_le16dec( - strm->next_in+2)) << 32) | - (((uint32_t)archive_le16dec( - strm->next_in+4)) << 16) | - archive_le16dec(strm->next_in+6); + ((uint64_t)strm->next_in[1]) << 56 | + ((uint64_t)strm->next_in[0]) << 48 | + ((uint64_t)strm->next_in[3]) << 40 | + ((uint64_t)strm->next_in[2]) << 32 | + ((uint32_t)strm->next_in[5]) << 24 | + ((uint32_t)strm->next_in[4]) << 16 | + ((uint32_t)strm->next_in[7]) << 8 | + (uint32_t)strm->next_in[6]; strm->next_in += 8; strm->avail_in -= 8; br->cache_avail += 8 * 8; @@ -2271,11 +2272,12 @@ lzx_br_fillup(struct lzx_stream *strm, struct lzx_br *br) if (strm->avail_in >= 6) { br->cache_buffer = (br->cache_buffer << 48) | - (((uint64_t)archive_le16dec( - strm->next_in)) << 32) | - (((uint32_t)archive_le16dec( - strm->next_in+2)) << 16) | - archive_le16dec(strm->next_in+4); + ((uint64_t)strm->next_in[1]) << 40 | + ((uint64_t)strm->next_in[0]) << 32 | + ((uint32_t)strm->next_in[3]) << 24 | + ((uint32_t)strm->next_in[2]) << 16 | + ((uint32_t)strm->next_in[5]) << 8 | + (uint32_t)strm->next_in[4]; strm->next_in += 6; strm->avail_in -= 6; br->cache_avail += 6 * 8; |