mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 05:50:14 +01:00
[cairo-matrix] Move IS_FINITE(det) checks before det==0 checks
I'm still getting floating point exceptions in test suite in a made-to-overflow test though. Not sure why isfinite() doesn't work.
This commit is contained in:
parent
9827dae570
commit
0621f412ff
1 changed files with 3 additions and 3 deletions
|
|
@ -490,10 +490,10 @@ cairo_matrix_invert (cairo_matrix_t *matrix)
|
|||
|
||||
_cairo_matrix_compute_determinant (matrix, &det);
|
||||
|
||||
if (det == 0)
|
||||
if (! ISFINITE (det))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
|
||||
|
||||
if (! ISFINITE (det))
|
||||
if (det == 0)
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);
|
||||
|
||||
_cairo_matrix_compute_adjoint (matrix);
|
||||
|
|
@ -510,7 +510,7 @@ _cairo_matrix_is_invertible (const cairo_matrix_t *matrix)
|
|||
|
||||
_cairo_matrix_compute_determinant (matrix, &det);
|
||||
|
||||
return det != 0. && ISFINITE (det);
|
||||
return ISFINITE (det) && det != 0.;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue