From 475d5986b7ba3796eb0aa93ec0b536f45e15b0a5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 19 Nov 2014 14:31:25 +0000 Subject: [PATCH] Fix bad default scale when sample aspect ratio is given as 0. --- src/lib/ffmpeg_examiner.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 46e93b16c..5ca05dd55 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -184,6 +184,10 @@ optional FFmpegExaminer::sample_aspect_ratio () const { AVRational sar = av_guess_sample_aspect_ratio (_format_context, _format_context->streams[_video_stream], 0); + if (sar.num == 0) { + /* I assume this means that we don't know */ + return optional (); + } return float (sar.num) / sar.den; } -- 2.30.2