Browse code

video4linux2: Avoid a floating point exception

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

(cherry picked from commit dc71f1958846bb1d96de43a4603983dc8450cfcc)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

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