aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index fa1ad2a7..0076921e 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -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)