Commit 812372dd authored by David Reid's avatar David Reid

Add some validation to mal_context_get_device_info().

parent 12e6b108
......@@ -15496,6 +15496,12 @@ mal_result mal_context_get_device_info(mal_context* pContext, mal_device_type ty
}
mal_mutex_unlock(&pContext->deviceInfoLock);
// Clamp ranges.
deviceInfo.minChannels = mal_max(deviceInfo.minChannels, MAL_MIN_CHANNELS);
deviceInfo.maxChannels = mal_min(deviceInfo.maxChannels, MAL_MAX_CHANNELS);
deviceInfo.minSampleRate = mal_max(deviceInfo.minSampleRate, MAL_MIN_SAMPLE_RATE);
deviceInfo.maxSampleRate = mal_min(deviceInfo.maxSampleRate, MAL_MAX_SAMPLE_RATE);
*pDeviceInfo = deviceInfo;
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment