[FFmpeg-cvslog] video4linux2: Avoid a floating point exception

Bernhard Übelacker git at videolan.org
Fri Aug 8 14:18:35 CEST 2014


ffmpeg | branch: release/1.1 | Bernhard Übelacker <bernhardu at vr-web.de> | Sun Jul 27 08:38:59 2014 -0700| [d16515ae5fe7daa6327d903cafb9a5ee43477b1e] | committer: Diego Biurrun

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 at biurrun.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d16515ae5fe7daa6327d903cafb9a5ee43477b1e
---

 avconv_opt.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/avconv_opt.c b/avconv_opt.c
index d6a6f8f..17ec0d9 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1520,7 +1520,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
             for (j = 0; j < nb_input_files; j++) {
                 for (i = 0; i < input_files[j]->nb_streams; i++) {
                     AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
-                    if (c->codec_type != AVMEDIA_TYPE_VIDEO)
+                    if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
+                        !c->time_base.num)
                         continue;
                     fr = c->time_base.den * 1000 / c->time_base.num;
                     if (fr == 25000) {



More information about the ffmpeg-cvslog mailing list