From 4d08da71e288c7b7be6c0455c0bb6834d4b318fd Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Thu, 4 Jan 2018 00:30:28 +0100 Subject: [PATCH] LogicSegment: Don't use new/delete in get_unpacked_sample() --- pv/data/logicsegment.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index 62f188e..38f4bf2 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -296,10 +296,11 @@ uint64_t LogicSegment::get_unpacked_sample(uint64_t index) const { assert(index < sample_count_); - uint8_t* data = new uint8_t[unit_size_]; + assert(unit_size_ <= 8); // 8 * 8 = 64 channels + uint8_t data[8]; + get_raw_samples(index, 1, data); uint64_t sample = unpack_sample(data); - delete[] data; return sample; } -- 2.30.2