diff options
| author | mayeut <mayeut@users.noreply.github.com> | 2015-10-15 15:52:01 +0200 |
|---|---|---|
| committer | mayeut <mayeut@users.noreply.github.com> | 2015-10-15 15:52:01 +0200 |
| commit | 9542c08d62297509a5097a3800478013c2534379 (patch) | |
| tree | fea5171edc71365d460221842599418ac09b5aa0 | |
| parent | cbaa2d7d9834a761638e3a767dc93eb3a8e66549 (diff) | |
Don't rely on float equality
Fix #591
| -rw-r--r-- | libopenjpeg/tcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index 62904eb2..190d7f99 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -988,7 +988,7 @@ void tcd_makelayer(opj_tcd_t *tcd, int layno, double thresh, int final) { n = passno + 1; continue; } - if (dd / dr >= thresh) + if (thresh - (dd / dr) < DBL_EPSILON) /* do not rely on float equality, check with DBL_EPSILON margin */ n = passno + 1; } layer->numpasses = n - cblk->numpassesinlayers; |
