# HG changeset patch # User William Pitcock # Date 1245417831 18000 # Node ID 2e988f44b85d70ab76d4c9b89bb31cba1012132e # Parent d3cf6d14c9605bd9f64c64ad9f34098835287065 alsa-ng: Don't crash on SND_PCM_FORMAT_UNKNOWN. diff -r d3cf6d14c960 -r 2e988f44b85d src/alsa-ng/alsa-core.c --- a/src/alsa-ng/alsa-core.c Fri Jun 19 07:59:56 2009 -0500 +++ b/src/alsa-ng/alsa-core.c Fri Jun 19 08:23:51 2009 -0500 @@ -290,6 +290,11 @@ snd_pcm_hw_params_t *hwparams = NULL; afmt = alsaplug_format_convert(fmt); + if (afmt == SND_PCM_FORMAT_UNKNOWN) + { + _ERROR("unsupported format requested: %d -> %d", fmt, afmt); + return -1; + } if ((err = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0)) < 0) {