lz4stream info to int: use memcpy

This commit is contained in:
Philippe Teuwen 2020-06-07 12:46:05 +02:00
commit d48fcbf5eb
2 changed files with 5 additions and 9 deletions

View file

@ -190,10 +190,8 @@ bool FpgaSetupSscDma(uint8_t *buf, int len) {
static int get_from_fpga_combined_stream(lz4_streamp compressed_fpga_stream, uint8_t *output_buffer) {
if (fpga_image_ptr == output_buffer + FPGA_RING_BUFFER_BYTES) { // need more data
fpga_image_ptr = output_buffer;
int cmp_bytes = *(compressed_fpga_stream->next_in + 3);
cmp_bytes = (cmp_bytes << 8) + *(compressed_fpga_stream->next_in+2);
cmp_bytes = (cmp_bytes << 8) + *(compressed_fpga_stream->next_in+1);
cmp_bytes = (cmp_bytes << 8) + *(compressed_fpga_stream->next_in+0);
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;
int res = LZ4_decompress_safe_continue(compressed_fpga_stream->lz4StreamDecode,