From: Eric Blossom Date: Thu, 20 May 2010 03:38:17 +0000 (-0700) Subject: Return immediately when using d_residual. X-Git-Url: https://git.gag.com/?p=debian%2Fgnuradio;a=commitdiff_plain;h=91054ed9fe7f08cac9738a6a6af5a9ad476ba24b Return immediately when using d_residual. (Otherwise recv may overwrite valid data in d_temp_buff.) --- diff --git a/gnuradio-core/src/lib/io/gr_udp_source.cc b/gnuradio-core/src/lib/io/gr_udp_source.cc index 1197a0c4..da5b8a19 100755 --- a/gnuradio-core/src/lib/io/gr_udp_source.cc +++ b/gnuradio-core/src/lib/io/gr_udp_source.cc @@ -243,7 +243,10 @@ gr_udp_source::work (int noutput_items, // Update indexing of amount of bytes left in the buffer d_residual -= nbytes; d_temp_offset += nbytes; - // FIXME? Returning here could simplify life... + + // Return now with what we've got. + assert(nbytes % d_itemsize == 0); + return nbytes/d_itemsize; } #if USE_SELECT