capture-reader: fix byte swap of frame info

If we are swapping between endianness, we were miss swapping various fields
and they'd all end up with the swapped len value.
This commit is contained in:
Christian Hergert
2018-02-13 16:34:41 -08:00
parent 44b3f6ba36
commit 0ec2c127ea

View File

@ -176,9 +176,9 @@ sp_capture_reader_bswap_frame (SpCaptureReader *self,
if (G_UNLIKELY (self->endian != G_BYTE_ORDER))
{
frame->len = GUINT16_SWAP_LE_BE (frame->len);
frame->cpu = GUINT16_SWAP_LE_BE (frame->len);
frame->pid = GUINT32_SWAP_LE_BE (frame->len);
frame->time = GUINT64_SWAP_LE_BE (frame->len);
frame->cpu = GUINT16_SWAP_LE_BE (frame->cpu);
frame->pid = GUINT32_SWAP_LE_BE (frame->pid);
frame->time = GUINT64_SWAP_LE_BE (frame->time);
}
}