diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-09 13:25:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-09 13:25:27 +0200 |
| commit | 491299eb073c80602ca8ee333303a31a581d3fa8 (patch) | |
| tree | f464aca94231b459c62f774a6a956f3e73c2bbce /src/lib/openjp2/j2k.c | |
| parent | 65c8f577d2f057e80040e98958eae80ca76c6b94 (diff) | |
| parent | 1c5627ee7406f84cfb40809b7ac31c63342427df (diff) | |
Merge pull request #1253 from rouault/floating_point_irreversible_encoding
Single-threaded performance improvements in forward DWT for 5-3 and 9-7 (and other improvements)
Diffstat (limited to 'src/lib/openjp2/j2k.c')
| -rw-r--r-- | src/lib/openjp2/j2k.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index c996cd88..08e79598 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -7822,6 +7822,14 @@ OPJ_BOOL opj_j2k_setup_encoder(opj_j2k_t *p_j2k, */ if (parameters->tile_size_on) { + if (cp->tdx == 0) { + opj_event_msg(p_manager, EVT_ERROR, "Invalid tile width\n"); + return OPJ_FALSE; + } + if (cp->tdy == 0) { + opj_event_msg(p_manager, EVT_ERROR, "Invalid tile height\n"); + return OPJ_FALSE; + } cp->tw = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(image->x1 - cp->tx0), (OPJ_INT32)cp->tdx); cp->th = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(image->y1 - cp->ty0), |
