diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-08 04:27:56 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-06-08 04:27:56 +0000 |
commit | 29ddf27b72960d6e6b115cd69812c9c57b2a7b13 (patch) | |
tree | 53f9ec0ec41f6032f8db4260fed6a63d71ea3fb4 /audio | |
parent | Fix error reporting under Win32 (CreateFile does not set errno) (diff) | |
download | qemu-kvm-29ddf27b72960d6e6b115cd69812c9c57b2a7b13.tar.gz qemu-kvm-29ddf27b72960d6e6b115cd69812c9c57b2a7b13.tar.bz2 qemu-kvm-29ddf27b72960d6e6b115cd69812c9c57b2a7b13.zip |
Check the returned audio_buf_info fields
At least on one system zero is returned in either fragsize or
fragstotal (reported by Dave Scott), this results in an audio_calloc
failing the audio_bug check and another ominous error message. Fail
early and blame the system.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4699 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'audio')
-rw-r--r-- | audio/ossaudio.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 2a300c21d..a29b4bc17 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -254,6 +254,12 @@ static int oss_open (int in, struct oss_params *req, goto err; } + if (!abinfo.fragstotal || !abinfo.fragsize) { + AUD_log (AUDIO_CAP, "Returned bogus buffer information(%d, %d) for %s\n", + abinfo.fragstotal, abinfo.fragsize, typ); + goto err; + } + obt->fmt = fmt; obt->nchannels = nchannels; obt->freq = freq; |