diff wav.c @ 3934:1aa5e41ceaef libavformat

Avoid segfault due to not set AVCodec.
author michael
date Wed, 24 Sep 2008 17:46:23 +0000
parents dfd3033e7de7
children 549a09cf23fe
line wrap: on
line diff
--- a/wav.c	Wed Sep 24 17:17:11 2008 +0000
+++ b/wav.c	Wed Sep 24 17:46:23 2008 +0000
@@ -45,7 +45,7 @@
     fmt = start_tag(pb, "fmt ");
     if (put_wav_header(pb, s->streams[0]->codec) < 0) {
         av_log(s, AV_LOG_ERROR, "%s codec not supported in WAVE format\n",
-               s->streams[0]->codec->codec->name);
+               s->streams[0]->codec->codec ? s->streams[0]->codec->codec->name : "NONE");
         av_free(wav);
         return -1;
     }