From f389fc5042f8ac0299f05be3ea1d3163b708eb97 Mon Sep 17 00:00:00 2001 From: Cillian O'Driscoll Date: Thu, 8 Oct 2015 12:03:15 +0100 Subject: [PATCH] Fixed a bug in endian reverse --- .../signal_source/gnuradio_blocks/unpack_2bit_samples.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc index fec047988..05c1e8bf5 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/unpack_2bit_samples.cc @@ -71,12 +71,14 @@ void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_s unsigned int i; unsigned int j = 0; int k = 0; + int l = 0; size_t skip = item_size - 1; for( i = 0; i < ninput_items; ++i ) { k = j + skip; - while( k >= 0 ) + l = j; + while( k >= l ) { out[j++] = in[k--]; }