avconv: Make sure the encoder exists before inspecting supported_list
authorMartin Storsjö <martin@martin.st>
Wed, 6 Mar 2013 13:01:36 +0000 (15:01 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 6 Mar 2013 19:56:10 +0000 (21:56 +0200)
This fixes crashes when there is no encoder for the default codec of
selected format.

Signed-off-by: Martin Storsjö <martin@martin.st>
avconv_filter.c

index cad68e2..2065cb0 100644 (file)
@@ -41,7 +41,7 @@ static char *choose_ ## var ## s(OutputStream *ost)                            \
     if (ost->st->codec->var != none) {                                         \
         get_name(ost->st->codec->var);                                         \
         return av_strdup(name);                                                \
-    } else if (ost->enc->supported_list) {                                     \
+    } else if (ost->enc && ost->enc->supported_list) {                         \
         const type *p;                                                         \
         AVIOContext *s = NULL;                                                 \
         uint8_t *ret;                                                          \