diff --git a/src/hpack-huff.c b/src/hpack-huff.c index 9c63e28e8..35fa52d59 100644 --- a/src/hpack-huff.c +++ b/src/hpack-huff.c @@ -31,6 +31,7 @@ #include #include +#include struct huff { uint32_t c; /* code point */ @@ -1439,17 +1440,11 @@ int huff_dec(const uint8_t *huff, int hlen, char *out, int olen) while (shift >= 32) { curr = next; - /* read up to 4 bytes into next. FIXME: this should - * later be optimized to perform a single 32-bit big - * endian read when unaligned accesses are possible. - */ + /* read up to 4 bytes into next */ next = 0; if (huff + 4 <= huff_end) { - next = ((uint32_t)huff[0] << 24) + - ((uint32_t)huff[1] << 16) + - ((uint32_t)huff[2] << 8) + - (uint32_t)huff[3]; + next = read_n32(huff); huff += 4; } else {