changeset 30386:d33d65802937

Fail ad_pcm initialization of WAVEFORMATEX header is missing instead of crashing.
author reimar
date Sun, 24 Jan 2010 20:46:26 +0000
parents b2c5e608155a
children 30d6f38357c7
files libmpcodecs/ad_pcm.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_pcm.c	Sun Jan 24 20:05:28 2010 +0000
+++ b/libmpcodecs/ad_pcm.c	Sun Jan 24 20:46:26 2010 +0000
@@ -21,6 +21,8 @@
 static int init(sh_audio_t *sh_audio)
 {
   WAVEFORMATEX *h=sh_audio->wf;
+  if (!h)
+    return 0;
   sh_audio->i_bps=h->nAvgBytesPerSec;
   sh_audio->channels=h->nChannels;
   sh_audio->samplerate=h->nSamplesPerSec;