Commit 29ddf27b72960d6e6b115cd69812c9c57b2a7b13
1 parent
7fb2a862
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
Showing
1 changed file
with
6 additions
and
0 deletions
audio/ossaudio.c
... | ... | @@ -254,6 +254,12 @@ static int oss_open (int in, struct oss_params *req, |
254 | 254 | goto err; |
255 | 255 | } |
256 | 256 | |
257 | + if (!abinfo.fragstotal || !abinfo.fragsize) { | |
258 | + AUD_log (AUDIO_CAP, "Returned bogus buffer information(%d, %d) for %s\n", | |
259 | + abinfo.fragstotal, abinfo.fragsize, typ); | |
260 | + goto err; | |
261 | + } | |
262 | + | |
257 | 263 | obt->fmt = fmt; |
258 | 264 | obt->nchannels = nchannels; |
259 | 265 | obt->freq = freq; | ... | ... |