summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-15 04:26:16 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-15 04:26:16 +0100
commitcc18ea8de05820a6c96f4d8afb8f3ce0e38c7793 (patch)
tree5a490afc74f143ed5f4ca5bde4f9b79474cae100 /libavformat/mov.c
parent47795505acea8daea3e18dc59df8bf7d8de3fc7e (diff)
avformat/mov: Do not set aspect ratios that would contain zeros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3da296bd07..556411f1ef 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);