[xiph-commits] r17704 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Thu Dec 2 06:11:13 PST 2010


Author: xiphmont
Date: 2010-12-02 06:11:13 -0800 (Thu, 02 Dec 2010)
New Revision: 17704

Modified:
   trunk/squishyball/audio.c
Log:
Better proof default device open against 'no available driver'.



Modified: trunk/squishyball/audio.c
===================================================================
--- trunk/squishyball/audio.c	2010-12-01 22:02:14 UTC (rev 17703)
+++ trunk/squishyball/audio.c	2010-12-02 14:11:13 UTC (rev 17704)
@@ -715,7 +715,13 @@
   if(!device){
     /* if we don't have an explicit device, defaults make this easy */
     int id = ao_default_driver_id();
-    aname=ao_driver_info(id)->short_name;
+    ao_info *ai;
+    if(id<0)
+      return NULL;
+    ai=ao_driver_info(id);
+    if(!ai)
+      return NULL;
+    aname=ai->short_name;
     ret=ao_open_live(id, &sf, &aoe);
   }else{
     /* Otherwise... there's some hunting to do. */



More information about the commits mailing list