From 503647557aa43e8be23133f8619c6c66bfe2f470 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 27 Aug 2019 08:40:01 +0200 Subject: Make InputBase::setBitrate fail with invalid_argument instead of return value --- src/input/Prbs.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/input/Prbs.cpp') diff --git a/src/input/Prbs.cpp b/src/input/Prbs.cpp index 821f7b1..5cbeee3 100644 --- a/src/input/Prbs.cpp +++ b/src/input/Prbs.cpp @@ -86,6 +86,9 @@ int Prbs::readFrame(uint8_t* buffer, size_t size) int Prbs::setBitrate(int bitrate) { + if (bitrate <= 0) { + throw invalid_argument("Invalid bitrate " + to_string(bitrate)); + } return bitrate; } -- cgit v1.2.3