diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-07 16:34:13 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-07 16:34:13 -0800 |
commit | d28e3ac765273d7684386c1985802000d22eeea6 (patch) | |
tree | 525744fa17ffa1e628cd28397bc424be83e594f7 /host/lib/transport | |
parent | f1434d7c52728cbf80e954b4c9414a94eec4c9ce (diff) | |
download | uhd-d28e3ac765273d7684386c1985802000d22eeea6.tar.gz uhd-d28e3ac765273d7684386c1985802000d22eeea6.tar.bz2 uhd-d28e3ac765273d7684386c1985802000d22eeea6.zip |
uhd: dont pass 0 sample buffs to converter (avoid segfaults)
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 4 | ||||
-rw-r--r-- | host/lib/transport/super_send_packet_handler.hpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 48b0acdb9..57aae96b1 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -523,7 +523,9 @@ private: } //copy-convert the samples from the recv buffer - _converter(buff_info.copy_buff, _io_buffs, nsamps_to_copy_per_io_buff, _scale_factor); + if (nsamps_to_copy_per_io_buff != 0) _converter( + buff_info.copy_buff, _io_buffs, nsamps_to_copy_per_io_buff, _scale_factor + ); //update the rx copy buffer to reflect the bytes copied buff_info.copy_buff += bytes_to_copy; diff --git a/host/lib/transport/super_send_packet_handler.hpp b/host/lib/transport/super_send_packet_handler.hpp index 5696b5d39..c3ffcc861 100644 --- a/host/lib/transport/super_send_packet_handler.hpp +++ b/host/lib/transport/super_send_packet_handler.hpp @@ -239,7 +239,9 @@ private: otw_mem += if_packet_info.num_header_words32; //copy-convert the samples into the send buffer - _converter(_io_buffs, otw_mem, nsamps_per_buff, _scale_factor); + if (nsamps_per_buff != 0) _converter( + _io_buffs, otw_mem, nsamps_per_buff, _scale_factor + ); //commit the samples to the zero-copy interface size_t num_bytes_total = (_header_offset_words32+if_packet_info.num_packet_words32)*sizeof(boost::uint32_t); |