Browse code

video4linux2: Avoid a floating point exception

This avoids a segfault in avconv_opt.c:opt_target when trying to
determine the norm.

Bernhard Übelacker authored on 2014/07/28 00:38:59
Showing 1 changed files
... ...
@@ -1757,7 +1757,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
1757 1757
             for (j = 0; j < nb_input_files; j++) {
1758 1758
                 for (i = 0; i < input_files[j]->nb_streams; i++) {
1759 1759
                     AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
1760
-                    if (c->codec_type != AVMEDIA_TYPE_VIDEO)
1760
+                    if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
1761
+                        !c->time_base.num)
1761 1762
                         continue;
1762 1763
                     fr = c->time_base.den * 1000 / c->time_base.num;
1763 1764
                     if (fr == 25000) {