Session: Fix mismatched delete operator.

Mismatched free() / delete / delete []
   at 0x4C2D31B: operator delete(void*) (vg_replace_malloc.c:576)
   by 0x1C76D0: operator() (unique_ptr.h:78)
   by 0x1C76D0: ~unique_ptr (unique_ptr.h:268)
   by 0x1C76D0: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
...
Address 0x1d123f70 is 0 bytes inside a block of size 312 alloc'd
   at 0x4C2C97F: operator new[](unsigned long) (vg_replace_malloc.c:423)
   by 0x1C765E: pv::data::AnalogSegment::append_interleaved_samples(float const*, unsigned long, unsigned long) (analogsegment.cpp:78)
   by 0x1AFDD5: pv::Session::feed_in_analog(std::shared_ptr<sigrok::Analog>) (session.cpp:1142)
This commit is contained in:
Philipp Marek 2017-11-18 13:53:24 +01:00
parent 09fa270252
commit a00f8221dc
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ void AnalogSegment::append_interleaved_samples(const float *data,
uint64_t prev_sample_count = sample_count_;
// Deinterleave the samples and add them
unique_ptr<float> deint_data(new float[sample_count]);
unique_ptr<float[]> deint_data(new float[sample_count]);
float *deint_data_ptr = deint_data.get();
for (uint32_t i = 0; i < sample_count; i++) {
*deint_data_ptr = (float)(*data);