projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Apply changes suggested by clang-tidy
[pulseview.git]
/
pv
/
storesession.cpp
diff --git
a/pv/storesession.cpp
b/pv/storesession.cpp
index 50815c26dcedfcaff7716f115b2eb376c371960a..494f2db3b91e7b8fe34ea1cfa56471f5ba4a8fc5 100644
(file)
--- a/
pv/storesession.cpp
+++ b/
pv/storesession.cpp
@@
-145,6
+145,7
@@
bool StoreSession::start()
uint64_t end_sample;
if (sample_range_.first == sample_range_.second) {
uint64_t end_sample;
if (sample_range_.first == sample_range_.second) {
+ // No sample range specified, save everything we have
start_sample_ = 0;
sample_count_ = any_segment->get_sample_count();
} else {
start_sample_ = 0;
sample_count_ = any_segment->get_sample_count();
} else {
@@
-159,6
+160,12
@@
bool StoreSession::start()
}
}
}
}
+ // Make sure the sample range is valid
+ if (start_sample_ > any_segment->get_sample_count()) {
+ error_ = tr("Can't save range without sample data.");
+ return false;
+ }
+
// Begin storing
try {
const auto context = session_.device_manager().context();
// Begin storing
try {
const auto context = session_.device_manager().context();