]> git.sesse.net Git - ffmpeg/commitdiff
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 cad68e2da3067f59a6dbbd1ecb2808ba63b76853..2065cb008b3f5ee0a596003034c3752304a8abef 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;                                                          \