From 0ec2c127ea3b6e8cda9460284be2a952100cd50b Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 13 Feb 2018 16:34:41 -0800 Subject: [PATCH] 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. --- lib/capture/sp-capture-reader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/capture/sp-capture-reader.c b/lib/capture/sp-capture-reader.c index a3614010..1ee85409 100644 --- a/lib/capture/sp-capture-reader.c +++ b/lib/capture/sp-capture-reader.c @@ -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); } }