diff options
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r-- | Alc/ALc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1704,8 +1704,10 @@ ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCenum err = ALC_INVALID_DEVICE; if((device=VerifyDevice(device)) != NULL && device->IsCaptureDevice) { + err = ALC_INVALID_VALUE; LockDevice(device); - err = ALCdevice_CaptureSamples(device, buffer, samples); + if(samples >= 0 && ALCdevice_AvailableSamples(device) >= (ALCuint)samples) + err = ALCdevice_CaptureSamples(device, buffer, samples); UnlockDevice(device); } if(err != ALC_NO_ERROR) |