Fix libdfu CRC check for big endian architectures

This is the first fix needed for #43, there are others yet.
This commit is contained in:
Mario Limonciello 2016-04-02 16:07:02 -05:00
parent a71c331923
commit 54c09e9c43

View File

@ -1016,7 +1016,7 @@ dfu_firmware_parse_data (DfuFirmware *firmware, GBytes *bytes,
/* verify the checksum */
priv->crc = GUINT32_FROM_LE (ftr->crc);
if ((flags & DFU_FIRMWARE_PARSE_FLAG_NO_CRC_TEST) == 0) {
crc_new = dfu_firmware_generate_crc32 (data, len - 4);
crc_new = GUINT32_FROM_LE (dfu_firmware_generate_crc32 (data, len - 4));
if (priv->crc != crc_new) {
g_set_error (error,
DFU_ERROR,