From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K5CVd-0001bQ-67 for qemu-devel@nongnu.org; Sun, 08 Jun 2008 00:28:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K5CVa-0001b7-Th for qemu-devel@nongnu.org; Sun, 08 Jun 2008 00:27:59 -0400 Received: from [199.232.76.173] (port=47763 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K5CVa-0001b0-Ln for qemu-devel@nongnu.org; Sun, 08 Jun 2008 00:27:58 -0400 Received: from savannah.gnu.org ([199.232.41.3]:58184 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K5CVa-0001A6-Is for qemu-devel@nongnu.org; Sun, 08 Jun 2008 00:27:58 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K5CVZ-0007Zv-41 for qemu-devel@nongnu.org; Sun, 08 Jun 2008 04:27:57 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K5CVY-0007Zr-Sc for qemu-devel@nongnu.org; Sun, 08 Jun 2008 04:27:57 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Sun, 08 Jun 2008 04:27:56 +0000 Subject: [Qemu-devel] [4699] Check the returned audio_buf_info fields Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 =================================================================== --- trunk/audio/ossaudio.c 2008-06-08 01:55:09 UTC (rev 4698) +++ trunk/audio/ossaudio.c 2008-06-08 04:27:56 UTC (rev 4699) @@ -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;