From 16dc008ec7294059375584e64f4675660e0c36d9 Mon Sep 17 00:00:00 2001 From: DreamSourceLab Date: Sun, 4 Jun 2017 23:55:43 +0800 Subject: [PATCH] fix crash and data error issue when export data to file --- DSView/pv/storesession.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DSView/pv/storesession.cpp b/DSView/pv/storesession.cpp index 37cba7f7..7ec17f0c 100644 --- a/DSView/pv/storesession.cpp +++ b/DSView/pv/storesession.cpp @@ -488,6 +488,8 @@ void StoreSession::export_proc(shared_ptr snapshot) for (int blk = 0; !boost::this_thread::interruption_requested() && blk < blk_num; blk++) { uint64_t buf_sample_num = logic_snapshot->get_block_size(blk) * 8; + buf_vec.clear(); + buf_sample.clear(); BOOST_FOREACH(const boost::shared_ptr s, _session.get_signals()) { int ch_type = s->get_type(); if (ch_type == SR_CHANNEL_LOGIC) { @@ -517,7 +519,7 @@ void StoreSession::export_proc(shared_ptr snapshot) return; } memset(xbuf, 0, size * unitsize); - for (uint64_t j = 0; j < usize; j++) { + for (uint64_t j = 0; j < size; j++) { for (unsigned int k = 0; k < buf_vec.size(); k++) { if (buf_vec[k] == NULL && buf_sample[k]) xbuf[j*unitsize+k/8] += 1 << k%8;