summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnathan Corgan <johnathan@corganlabs.com>2016-01-27 09:50:09 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2016-01-27 09:50:09 -0800
commit393624c072417e0b8a74480979eeccdfb8278e77 (patch)
treed7e48b806c0ff352f26b68ee405cd8d58413c873
parent3b0e0ae7ca5ade113910ceb674081322c063c83f (diff)
parent9606e1f92541f4495973bc78d4cba0f053949042 (diff)
Merge remote-tracking branch 'tom/issue768' into maint
-rw-r--r--gnuradio-runtime/lib/block_executor.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/block_executor.cc b/gnuradio-runtime/lib/block_executor.cc
index ded1324fa3..ef2e4948bd 100644
--- a/gnuradio-runtime/lib/block_executor.cc
+++ b/gnuradio-runtime/lib/block_executor.cc
@@ -370,12 +370,25 @@ namespace gr {
// ask the block how much input they need to produce noutput_items
m->forecast (noutput_items, d_ninput_items_required);
- // See if we've got sufficient input available
+ // See if we've got sufficient input available and make sure we
+ // didn't overflow on the input.
int i;
- for(i = 0; i < d->ninputs (); i++)
+ for(i = 0; i < d->ninputs (); i++) {
if(d_ninput_items_required[i] > d_ninput_items[i]) // not enough
break;
+ if(d_ninput_items_required[i] < 0) {
+ std::cerr << "\nsched: <block " << m->name()
+ << " (" << m->unique_id() << ")>"
+ << " thinks its ninput_items required is "
+ << d_ninput_items_required[i]
+ << " and cannot be negative.\n"
+ << "Some parameterization is wrong. "
+ << "Too large a decimation value?\n\n";
+ goto were_done;
+ }
+ }
+
if(i < d->ninputs()) { // not enough input on input[i]
// if we can, try reducing the size of our output request
if(noutput_items > m->output_multiple()) {