summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core')
-rw-r--r--gnuradio-core/src/lib/general/gr_framer_sink_1.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
index 1d939adbd..be5209a71 100644
--- a/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
+++ b/gnuradio-core/src/lib/general/gr_framer_sink_1.cc
@@ -57,6 +57,11 @@ gr_framer_sink_1::enter_have_header(int payload_len, int whitener_offset)
if (VERBOSE)
fprintf(stderr, "@ enter_have_header (payload_len = %d) (offset = %d)\n", payload_len, whitener_offset);
+ if (payload_len < 4) { // should be at least the length of the CRC field
+ enter_search();
+ return;
+ }
+
d_state = STATE_HAVE_HEADER;
d_packetlen = payload_len;
d_packet_whitener_offset = whitener_offset;