X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.cpp;h=4f6bc41d551c4182919539cb3810882f9e10e60d;hp=1a05907c9c1a4470be862fdf2691887411b915e3;hb=40ec0302a21055e85572ced539c457f0d8484c82;hpb=be7645e8d02d1865f9bc1a4a9bb397812ea3c380 diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 1a05907..4f6bc41 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -74,6 +74,7 @@ using std::cerr; using std::endl; using std::list; using std::map; +using std::max; using std::pair; using std::shared_ptr; using std::string; @@ -257,7 +258,8 @@ void MainWindow::export_file(shared_ptr format, const pv::util::Timestamp& start_time = view_->cursors()->first()->time(); const pv::util::Timestamp& end_time = view_->cursors()->second()->time(); - const uint64_t start_sample = start_time.convert_to() * samplerate; + const uint64_t start_sample = + std::max((double)0, start_time.convert_to() * samplerate); const uint64_t end_sample = end_time.convert_to() * samplerate; sample_range = std::make_pair(start_sample, end_sample);