Skip to content
Snippets Groups Projects
Commit 6404cc37 authored by Vincent Lucas's avatar Vincent Lucas
Browse files

Corrects invalid read access from the MacOsX/Windows libjitsi coreaudio...

Corrects invalid read access from the MacOsX/Windows libjitsi coreaudio library when creating or receiving a call without any microphone connected.
parent 77b8329d
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,11 @@ public CoreAudioVolumeControl( ...@@ -51,6 +51,11 @@ public CoreAudioVolumeControl(
*/ */
protected int setInputDeviceVolume(String deviceUID, float volume) protected int setInputDeviceVolume(String deviceUID, float volume)
{ {
if(deviceUID == null)
{
return -1;
}
// Changes the input volume of the capture device. // Changes the input volume of the capture device.
if(CoreAudioDevice.setInputDeviceVolume(deviceUID, volume) != 0) if(CoreAudioDevice.setInputDeviceVolume(deviceUID, volume) != 0)
{ {
...@@ -71,6 +76,11 @@ protected int setInputDeviceVolume(String deviceUID, float volume) ...@@ -71,6 +76,11 @@ protected int setInputDeviceVolume(String deviceUID, float volume)
*/ */
protected float getInputDeviceVolume(String deviceUID) protected float getInputDeviceVolume(String deviceUID)
{ {
if(deviceUID == null)
{
return -1;
}
float volume = CoreAudioDevice.getInputDeviceVolume(deviceUID); float volume = CoreAudioDevice.getInputDeviceVolume(deviceUID);
if(logger.isDebugEnabled() && (volume != 0)) if(logger.isDebugEnabled() && (volume != 0))
......
...@@ -51,6 +51,11 @@ public CoreAudioVolumeControl( ...@@ -51,6 +51,11 @@ public CoreAudioVolumeControl(
*/ */
protected int setInputDeviceVolume(String deviceUID, float volume) protected int setInputDeviceVolume(String deviceUID, float volume)
{ {
if(deviceUID == null)
{
return -1;
}
if(CoreAudioDevice.initDevices() == -1) if(CoreAudioDevice.initDevices() == -1)
{ {
CoreAudioDevice.freeDevices(); CoreAudioDevice.freeDevices();
...@@ -83,6 +88,11 @@ protected float getInputDeviceVolume(String deviceUID) ...@@ -83,6 +88,11 @@ protected float getInputDeviceVolume(String deviceUID)
{ {
float volume; float volume;
if(deviceUID == null)
{
return -1;
}
if(CoreAudioDevice.initDevices() == -1) if(CoreAudioDevice.initDevices() == -1)
{ {
CoreAudioDevice.freeDevices(); CoreAudioDevice.freeDevices();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment