to avoid this error:
zlib-ng/arch/x86/deflate_quick.c:154:5: runtime error: store to misaligned address 0x631000014801 for type 'unsigned int', which requires 4 byte alignment
0x631000014801: note: pointer points here
00 80 02 d3 07 00 00 be be be be be be be be be be be be be be be be be be be be be be be be be
^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior zlib-ng/arch/x86/deflate_quick.c:154:5 in
# include <nmmintrin.h>
#endif
#include "deflate.h"
+#include "memcopy.h"
#ifdef ZLIB_DEBUG
#include <ctype.h>
s->bi_valid = width - (bytes_out * 8);
/* Taking advantage of the fact that LSB comes first, write to output buffer */
- *(unsigned *)(s->pending_buf + s->pending) = out;
+ MEMCPY(s->pending_buf + s->pending, &out, sizeof(out));
s->pending += bytes_out;
}