Fixed parameter validation for Wave encoder.

This commit is contained in:
LoRd_MuldeR 2016-04-06 00:19:41 +02:00
parent 7ced6160c2
commit ce37f51a3d
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 4 #define VER_LAMEXP_MINOR_LO 4
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 7 #define VER_LAMEXP_PATCH 7
#define VER_LAMEXP_BUILD 1874 #define VER_LAMEXP_BUILD 1876
#define VER_LAMEXP_CONFG 1818 #define VER_LAMEXP_CONFG 1818
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -57,7 +57,8 @@ void AbstractEncoder::setRCMode(const int &mode)
void AbstractEncoder::setBitrate(const int &bitrate) void AbstractEncoder::setBitrate(const int &bitrate)
{ {
if (qMax(0, bitrate) >= toEncoderInfo()->valueCount(m_configRCMode)) const int valueCount = toEncoderInfo()->valueCount(m_configRCMode);
if ((valueCount > 0) && (qMax(0, bitrate) >= valueCount))
{ {
MUTILS_THROW("The specified bitrate/quality is out of range!"); MUTILS_THROW("The specified bitrate/quality is out of range!");
} }