From: Steinar H. Gunderson Date: Sat, 2 Apr 2016 18:17:30 +0000 (+0200) Subject: Fix an integer wraparound issue. X-Git-Tag: 1.2.0~26 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c86f05364052dad02972a3d5be68c64e68c07221;p=nageru Fix an integer wraparound issue. --- diff --git a/mixer.cpp b/mixer.cpp index 2802329..84335aa 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -123,7 +123,7 @@ void QueueLengthPolicy::update_policy(int queue_length) return; } if (queue_length > 0) { - if (++frames_with_at_least_one >= 50) { + if (++frames_with_at_least_one >= 50 && safe_queue_length > 0) { --safe_queue_length; fprintf(stderr, "Card %u: Spare frames for more than 50 frames, reducing safe limit to %u frames\n", card_index, safe_queue_length);