mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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>
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user