mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-04-12 23:40:05 +08:00
lz4/fpga_compress: avoid alignment problems
fpga_compress.c:176:32: warning: cast from 'char *' to 'int *' increases required alignment from 1 to 4 [-Wcast-align] const int cmp_bytes = *(int*)(compressed_fpga_stream.next_in); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
df9f34ba2b
commit
ef6b775f9f
1 changed files with 2 additions and 1 deletions
|
@ -173,7 +173,8 @@ static int zlib_decompress(FILE *infile, FILE *outfile) {
|
|||
|
||||
int total_size = 0;
|
||||
while (compressed_fpga_stream.avail_in > 0) {
|
||||
const int cmp_bytes = *(int*)(compressed_fpga_stream.next_in);
|
||||
int cmp_bytes;
|
||||
memcpy(&cmp_bytes, compressed_fpga_stream.next_in, sizeof(int));
|
||||
compressed_fpga_stream.next_in += 4;
|
||||
compressed_fpga_stream.avail_in -= cmp_bytes + 4;
|
||||
const int decBytes = LZ4_decompress_safe_continue(compressed_fpga_stream.lz4StreamDecode, compressed_fpga_stream.next_in, outbuf, cmp_bytes, FPGA_RING_BUFFER_BYTES);
|
||||
|
|
Loading…
Add table
Reference in a new issue