Avoid a leak if PortAudio fails to give a usable channel count

This commit is contained in:
Chris Robinson
2012-03-02 02:14:04 -08:00
parent f784aa704d
commit b571926a6d
+2 -2
View File
@@ -222,8 +222,6 @@ retry_open:
return ALC_INVALID_VALUE;
}
device->szDeviceName = strdup(deviceName);
if((ALuint)outParams.channelCount != ChannelsFromDevFmt(device->FmtChans))
{
if(outParams.channelCount != 1 && outParams.channelCount != 2)
@@ -241,6 +239,8 @@ retry_open:
}
SetDefaultChannelOrder(device);
device->szDeviceName = strdup(deviceName);
return ALC_NO_ERROR;
}