coreaudio: Verify valid lineId in MIXER_GETLINECONTROLSF_ONEBYTYPE.

This commit is contained in:
Aric Stewart 2007-11-29 13:42:39 +09:00 committed by Alexandre Julliard
parent 35ecb1b6ee
commit b314f13219
1 changed files with 5 additions and 0 deletions

View File

@ -760,6 +760,11 @@ static DWORD MIX_GetLineControls(WORD wDevID, LPMIXERLINECONTROLSW lpMlc, DWORD_
break;
case MIXER_GETLINECONTROLSF_ONEBYTYPE:
TRACE("dwLineID=%d MIXER_GETLINECONTROLSF_ONEBYTYPE (%s)\n", lpMlc->dwLineID, getControlType(lpMlc->u.dwControlType));
if ( (lpMlc->dwLineID < 0) || (lpMlc->dwLineID >= mixer.caps.cDestinations) )
{
ret = MIXERR_INVALLINE;
break;
}
if (lpMlc->u.dwControlType == MIXERCONTROL_CONTROLTYPE_VOLUME)
{
ctrl = (lpMlc->dwLineID * ControlsPerLine) + IDControlVolume;