X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Flogicsegment.cpp;h=dab6b91dee295194f343115c7f2cdeecec5657e6;hp=a5634b30e5d6f93fd0495ae26e9e56dc5325e716;hb=038a14278afb24e10cd59991c2cafd97264fd3a5;hpb=c28fa62bc89656ba3b1b01011a45e941d6c7d42a
diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp
index a5634b3..dab6b91 100644
--- a/pv/data/logicsegment.cpp
+++ b/pv/data/logicsegment.cpp
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include
@@ -153,10 +152,9 @@ void LogicSegment::append_payload(shared_ptr logic)
append_payload_to_mipmap();
}
-void LogicSegment::get_samples(uint8_t *const data,
- int64_t start_sample, int64_t end_sample) const
+const uint8_t* LogicSegment::get_samples(int64_t start_sample,
+ int64_t end_sample) const
{
- assert(data);
assert(start_sample >= 0);
assert(start_sample <= (int64_t)sample_count_);
assert(end_sample >= 0);
@@ -165,8 +163,10 @@ void LogicSegment::get_samples(uint8_t *const data,
lock_guard lock(mutex_);
+ uint8_t* data = new uint8_t[end_sample - start_sample];
const size_t size = (end_sample - start_sample) * unit_size_;
- memcpy(data, (const uint8_t*)data_.data() + start_sample * unit_size_, size);
+ memcpy(data, (uint8_t*)data_.data() + start_sample * unit_size_, size);
+ return data;
}
void LogicSegment::reallocate_mipmap_level(MipMapLevel &m)