From 8a478e4616fc92c7fd96750da8c503a2a9af9839 Mon Sep 17 00:00:00 2001 From: orignal Date: Sun, 25 Jan 2015 22:01:09 -0500 Subject: [PATCH] check for max number of NACKs --- Streaming.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Streaming.cpp b/Streaming.cpp index f6b50176..680444b6 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -378,6 +378,12 @@ namespace stream for (auto it: m_SavedPackets) { auto seqn = it->GetSeqn (); + if (numNacks + (seqn - nextSeqn) >= 256) + { + LogPrint (eLogError, "Number of NACKs exceeds 256"); + htobe32buf (packet + 12, nextSeqn); // change ack Through + break; + } for (uint32_t i = nextSeqn; i < seqn; i++) { htobe32buf (nacks, i);