[FFmpeg-cvslog] avformat/mov: Do not set aspect ratios that would contain zeros

Michael Niedermayer git at videolan.org
Thu Jan 15 04:34:43 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan 15 04:26:16 2015 +0100| [cc18ea8de05820a6c96f4d8afb8f3ce0e38c7793] | committer: Michael Niedermayer

avformat/mov: Do not set aspect ratios that would contain zeros

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mov.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3da296b..556411f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2874,7 +2874,8 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         for (i = 0; i < 2; i++)
             disp_transform[i] = sqrt(SQR(display_matrix[i][0]) + SQR(display_matrix[i][1]));
 
-        if (fabs((disp_transform[0] / disp_transform[1]) - 1.0) > 0.01)
+        if (disp_transform[0] > 0 && disp_transform[1] > 0 &&
+            fabs((disp_transform[0] / disp_transform[1]) - 1.0) > 0.01)
             st->sample_aspect_ratio = av_d2q(
                 disp_transform[0] / disp_transform[1],
                 INT_MAX);



More information about the ffmpeg-cvslog mailing list