summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-21 16:53:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-22 19:52:52 +0100
commite32b07aea4981719a3e6ce92491349c9547958e1 (patch)
treee23d30924a9350174b32b91d4e11dc7e18e175d3 /libavformat/mov.c
parent41e983f1a63927dc0a2596cf2f0f7a946a048f11 (diff)
avformat/mov: Stricter sanity checks on the display_matrix
Fixes "broken" tkhd Found-by: koda Tested-by: koda 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 556411f1ef..6851947f9a 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 (disp_transform[0] > 0 && disp_transform[1] > 0 &&
+ if (disp_transform[0] > 0 && disp_transform[1] > 0 &&
+ disp_transform[0] < (1<<24) && disp_transform[1] < (1<<24) &&
fabs((disp_transform[0] / disp_transform[1]) - 1.0) > 0.01)
st->sample_aspect_ratio = av_d2q(
disp_transform[0] / disp_transform[1],