commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 04/21: qtgui: Throw an error if the PDU is


From: git
Subject: [Commit-gnuradio] [gnuradio] 04/21: qtgui: Throw an error if the PDU is not a multiple of the fft size.
Date: Fri, 30 Oct 2015 21:11:26 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 2f79e9471a7e87477ac5b1edce91abac10f806ea
Author: Tom Rondeau <address@hidden>
Date:   Wed Oct 21 13:25:06 2015 -0400

    qtgui: Throw an error if the PDU is not a multiple of the fft size.
    
    Can crash if this condition is not bet.
    
    Also, rearraigned the order of the message ports so the PDU port is
    always available.
---
 gr-qtgui/grc/qtgui_waterfall_sink_x.xml | 5 ++---
 gr-qtgui/lib/waterfall_sink_c_impl.cc   | 4 ++++
 gr-qtgui/lib/waterfall_sink_f_impl.cc   | 4 ++++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml 
b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
index f0d0c60..128172b 100644
--- a/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
+++ b/gr-qtgui/grc/qtgui_waterfall_sink_x.xml
@@ -494,14 +494,13 @@ $(gui_hint()($win))</make>
   </sink>
 
   <sink>
-    <name>freq</name>
+    <name>pdus</name>
     <type>message</type>
     <optional>1</optional>
-    <hide>$showports</hide>
   </sink>
 
   <sink>
-    <name>pdus</name>
+    <name>freq</name>
     <type>message</type>
     <optional>1</optional>
     <hide>$showports</hide>
diff --git a/gr-qtgui/lib/waterfall_sink_c_impl.cc 
b/gr-qtgui/lib/waterfall_sink_c_impl.cc
index 2c4045a..da732c2 100644
--- a/gr-qtgui/lib/waterfall_sink_c_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_c_impl.cc
@@ -568,6 +568,10 @@ namespace gr {
         pmt::pmt_t samples = pmt::cdr(msg);
 
         len = pmt::length(samples);
+        if(len % d_fftsize != 0) {
+          throw std::runtime_error("waterfall_sink_c::handle_pdus: PDU must be 
"
+                                   "a multiple of the FFT size.");
+        }
 
         pmt::pmt_t start_key = pmt::string_to_symbol("start");
         if(pmt::dict_has_key(dict, start_key)) {
diff --git a/gr-qtgui/lib/waterfall_sink_f_impl.cc 
b/gr-qtgui/lib/waterfall_sink_f_impl.cc
index d8ee567..90043b9 100644
--- a/gr-qtgui/lib/waterfall_sink_f_impl.cc
+++ b/gr-qtgui/lib/waterfall_sink_f_impl.cc
@@ -577,6 +577,10 @@ namespace gr {
         pmt::pmt_t samples = pmt::cdr(msg);
 
         len = pmt::length(samples);
+        if(len % d_fftsize != 0) {
+          throw std::runtime_error("waterfall_sink_f::handle_pdus: PDU must be 
"
+                                   "a multiple of the FFT size.");
+        }
 
         pmt::pmt_t start_key = pmt::string_to_symbol("start");
         if(pmt::dict_has_key(dict, start_key)) {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]