diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2014-09-14 14:35:56 -0400 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-09-14 21:07:30 +0200 |
commit | 3f6212cd8d2d8a86bb913d00463620cd2abbc8d9 (patch) | |
tree | 77523330edb4cd59b1930fb988a50c4231099fdd /video/out/gl_video.c | |
parent | e0b4daf3ad240ecf70af73c13b6ca9b1062a507f (diff) | |
download | mpv-3f6212cd8d2d8a86bb913d00463620cd2abbc8d9.tar.bz2 mpv-3f6212cd8d2d8a86bb913d00463620cd2abbc8d9.tar.xz |
sanitizer: avoid divide-by-zero instances
Merges pull request #1094, with some minor changes. mpv expects IEEE,
and IEEE allows divisions by 0 for floats, so these shouldn't actually
be a problem, but do it anyway for the sake of clang.
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'video/out/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index e2b64968ce..5923a697e9 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -573,7 +573,7 @@ static void update_uniforms(struct gl_video *p, GLuint program) } loc = gl->GetUniformLocation(program, "transform"); - if (loc >= 0) { + if (loc >= 0 && p->vp_w > 0 && p->vp_h > 0) { float matrix[3][3]; matrix_ortho2d(matrix, 0, p->vp_w, p->vp_h, 0); gl->UniformMatrix3fv(loc, 1, GL_FALSE, &matrix[0][0]); |