From 2abda17d8ed2794ff5b4bc0d9f61d30d8ffac651 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 29 Sep 2012 20:29:27 -0700 Subject: core: fix implicit assumption in skiphead skiphead is a gr_block, not sync block, but assumes that the number of input items is at least the number of output items remove this assumption and make this safe with std::min(ninputs, noutputs) may be necessary with new scheduler patches that can vary the circular buffer sizes --- gnuradio-core/src/lib/general/gr_skiphead.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core/src/lib/general/gr_skiphead.cc') diff --git a/gnuradio-core/src/lib/general/gr_skiphead.cc b/gnuradio-core/src/lib/general/gr_skiphead.cc index c887376e4..7b441bea9 100644 --- a/gnuradio-core/src/lib/general/gr_skiphead.cc +++ b/gnuradio-core/src/lib/general/gr_skiphead.cc @@ -43,14 +43,14 @@ gr_make_skiphead (size_t itemsize, uint64_t nitems_to_skip) int gr_skiphead::general_work(int noutput_items, - gr_vector_int &ninput_items_ignored, + gr_vector_int &ninput_items_, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { const char *in = (const char *) input_items[0]; char *out = (char *) output_items[0]; - int ninput_items = noutput_items; // we've got at least this many input items + int ninput_items = std::min(ninput_items_[0], noutput_items); int ii = 0; // input index while (ii < ninput_items){ -- cgit