[4699] Check the returned audio_buf_info fields
Revision: 4699
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4699 Author: malc Date: 2008-06-08 04:27:56 +0000 (Sun, 08 Jun 2008)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/audio/ossaudio.c
Modified: trunk/audio/ossaudio.c
===================================================================
audio/ossaudio.c +6 -0
@@ -254,6 +254,12 @@ 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;