summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2017-09-05 22:18:58 +0200
committerGitHub <noreply@github.com>2017-09-05 22:18:58 +0200
commit968e36bbd989fdf789c6a02c80c747346bb851c5 (patch)
tree6773f7cdc63663119105f031c2c5499cc9c5ffd7 /src/bin
parent3a382d312306f45853b3ad78b770754d4bc7e440 (diff)
parent579b8937eae7e6b6868b8b5c6286a742c10a5130 (diff)
Merge pull request #1010 from rouault/subtile_decoding_stage3
Subtile decoding: memory use reduction and perf improvements
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/jp2/opj_compress.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/jp2/opj_compress.c b/src/bin/jp2/opj_compress.c
index 58fdaaec..26454d9e 100644
--- a/src/bin/jp2/opj_compress.c
+++ b/src/bin/jp2/opj_compress.c
@@ -908,8 +908,9 @@ static int parse_cmdline_encoder(int argc, char **argv,
case 'b': { /* code-block dimension */
int cblockw_init = 0, cblockh_init = 0;
sscanf(opj_optarg, "%d,%d", &cblockw_init, &cblockh_init);
- if (cblockw_init * cblockh_init > 4096 || cblockw_init > 1024
- || cblockw_init < 4 || cblockh_init > 1024 || cblockh_init < 4) {
+ if (cblockw_init > 1024 || cblockw_init < 4 ||
+ cblockh_init > 1024 || cblockh_init < 4 ||
+ cblockw_init * cblockh_init > 4096) {
fprintf(stderr,
"!! Size of code_block error (option -b) !!\n\nRestriction :\n"
" * width*height<=4096\n * 4<=width,height<= 1024\n\n");