X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Ftoolbars%2Fmainbar.cpp;h=34b120fec11ce0ec14bf21f16cc717e7b9d74222;hp=1879693d57a31c01bc87458f556d67dd01db7506;hb=7b7ab1f5cb3607bf29885eeffcb2cb215b2c9e9f;hpb=7671200bd71de8cdd922b41b025ea18de6422345 diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 1879693d..34b120fe 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -612,6 +612,13 @@ void MainBar::export_file(shared_ptr format, bool selection_only) const uint64_t end_sample = (uint64_t)max( (double)0, end_time.convert_to() * samplerate); + if ((start_sample == 0) && (end_sample == 0)) { + // Both cursors are negative and were clamped to 0 + show_session_error(tr("Invalid Range"), tr("The cursors don't " \ + "define a valid range of samples.")); + return; + } + sample_range = make_pair(start_sample, end_sample); } else { sample_range = make_pair(0, 0);