qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4699] Check the returned audio_buf_info fields


From: malc
Subject: [Qemu-devel] [4699] Check the returned audio_buf_info fields
Date: Sun, 08 Jun 2008 04:27:56 +0000

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;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]