Commit Graph

967 Commits

Author SHA1 Message Date
Even Rouault 0c913b0aba
Avoid assertion when running opj_j2k_merge_ppt() several time due to e6674f7ed66abdb32a0be5944f618722b6a7b5d5 revert. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785 2018-06-20 15:12:47 +02:00
Even Rouault 832dfd1866
Revert "Avoid assertion in opj_j2k_merge_ppt() in case premature EOC is encountered in opj_j2k_read_tile_header(). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785. Credit to OSS Fuzz" (fixes #1120)
This reverts commit 9906fbf737.
which broke decoding of images where TNsot == 0
2018-06-20 14:54:20 +02:00
Even Rouault fd205f457b
opj_compress: try to make help message of -c switch clearer (fixes #1117) 2018-06-16 16:17:58 +02:00
Even Rouault 2c7eb4fed9 opj_compress: fix help message regarding default precinct size 2018-03-12 14:24:20 +01:00
Even Rouault e98d0a20f0
Merge pull request #1094 from kbabioch/fix/missing-format-string-parameter
mj2: Add missing variable to format string in fprintf() invocation in meta_out.c
2018-03-04 23:16:04 +01:00
Even Rouault 31a347a9a0
Merge pull request #1096 from kbabioch/fix/opj_mj2_extract-help
opj_mj2_extract: Rename output_location to output_prefix
2018-03-04 23:13:45 +01:00
Karol Babioch e351c22ee8 jp3d: Replace sprintf() by snprintf() in volumetobin()
This replaces the unsafe sprintf() invocation by the safer snprintf()
one, with the correct buffer size to prevent buffer overflows.

This fixes #1085.
2018-03-03 10:11:39 +01:00
Karol Babioch db6841a099 opj_mj2_extract: Rename output_location to output_prefix
This renames the argument in the help output, as the latter better describes
the the purpose of this argument.
2018-03-02 15:19:21 +01:00
Karol Babioch d4d78272eb mj2: Add missing variable to format string in fprintf() invocation in meta_out.c
This adds the appropriate variables to the invocation of fprintf(). They were
specified in the format string, but were missing in the actual call. This
fixes #1074 and #1075.
2018-03-02 14:03:08 +01:00
Stefan Weil b49fa93aa7 openjp3d: Convert ISO-8859 to UTF-8
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-02-25 18:27:01 +01:00
Stefan Weil 244f52483d jp3d: Convert ISO-8859 to UTF-8
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2018-02-25 18:25:51 +01:00
Even Rouault 90b1bffa7e
Merge pull request #1080 from setharnold/patch-1
fix unchecked integer multiplication overflow
2018-02-25 18:21:23 +01:00
Even Rouault 06f7d41243 bench_dwt: fix wrong index in iteration (issue found by Fethi Migaou) 2018-02-18 14:38:16 +01:00
setharnold 24d08ff94a
fix unchecked integer multiplication overflow
Hello, this fixes an unchecked integer multiplication overflow. Thanks.
2018-02-14 17:46:38 -08:00
Even Rouault da5e897232 Avoid out-of-bounds write overflow due to uint32 overflow computation on images with huge dimensions. Credit to Google Autofuzz project for providing test case 2018-02-11 13:31:04 +01:00
Campbell Barton 6941bc67cf
Note that seek uses SEEK_SET behavior. 2018-01-18 15:16:03 +11:00
Even Rouault 07d526e4cb opj_t2_encode_packet(): disable setting empty packet header bit to 1 when there is an empty packet
This effectively reverts commit 2609fb8077
since it has been reported that
such packets cause decoding issues with cinema J2K hardware
decoders: https://groups.google.com/forum/#!topic/openjpeg/M7M_fLX_Bco
2018-01-08 09:38:44 +01:00
Stefan Weil 4841292b5d Fix resource leak (CID 179466)
Coverity report:

CID 179466 (#1 of 1): Resource leak (RESOURCE_LEAK)
93. leaked_storage: Variable name going out of scope leaks the storage it points to.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-12-15 16:49:33 +01:00
Even Rouault 98cfdd3134 opj_j2k_read_cod: remove check for 'No more than one COD marker per tile' (fixes #1043)
This check was added per daed8cc919
to fix https://github.com/uclouvain/openjpeg/issues/476 , but it does not seem
to be necessary with latest master (issue476.jp2 doesn't cause memory issues),
and breaks reading legit files.
2017-11-30 14:48:34 +01:00
Even Rouault 936910cf7a Fix typo in comments 2017-11-30 14:26:17 +01:00
Andrew Murray 157a3d8408 Changed cmake version test to allow for cmake 2.8.11.x 2017-11-14 21:45:09 +11:00
Gregory Fiumara 10d22ec26d Add missing fclose() statement in error condition. 2017-10-20 15:31:45 -04:00
Even Rouault be6ea90e13 opj_j2k_set_threads(): add sanity check to error out if called after opj_read_header() 2017-10-12 01:16:23 +02:00
Even Rouault b8bf9bf789 Improve doc of opj_codec_set_threads() 2017-10-12 01:05:04 +02:00
Even Rouault 66297f07a4 Unix build: fix regression of 2.3.0 where a shared-only or static-only build lacks the installation target for the library (#1019, fixes regression introduced by 3dfc6ca2bc) 2017-10-09 11:40:43 +02:00
Even Rouault e8b6b54d1f opj_decompress -h: document -threads ALL_CPUS 2017-10-06 19:25:07 +02:00
Antonin Descampe d45ccb048b Merge pull request #1022 from rouault/partial_component_decoding
Add capability to decode only a subset of all components of an image.
2017-09-26 18:30:20 -03:00
Stefan Weil f92d30f9e7 Add missing newline at end of file
This fixes warnings from the clang compiler:

/openjpeg/src/lib/openjp2/sparse_array.h:141:32: warning:
 no newline at end of file [-Wnewline-eof]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2017-09-21 17:37:07 +02:00
Even Rouault 4c8aba2add Add assertion 2017-09-21 14:37:01 +02:00
Even Rouault 113e0976e2 Comment dead code (Coverity CID 94681) 2017-09-21 14:14:32 +02:00
Even Rouault 39082fc665 Workaround Coverity CID 113061 2017-09-21 14:13:16 +02:00
Even Rouault 7711307d86 Workaround Coverity CID 169392 2017-09-21 14:10:49 +02:00
Even Rouault 19e157871f opj_j2k_get_default_thread_count(): validate value of OPJ_NUM_THREADS to fix Coverity 179465 and 179463 2017-09-21 14:06:03 +02:00
Even Rouault 68e596dada Fix copy&paste error (Coverity CID 169394) 2017-09-21 13:54:14 +02:00
Even Rouault 16b701659d opj_decompress: add a warning when -d and -t are used together (#693) 2017-09-20 01:06:02 +02:00
Even Rouault b8c4b450c4 Use a #define J2K_MAX_POCS 32 to avoid hard-coded constant (#349) 2017-09-20 00:55:22 +02:00
Even Rouault 9cba05762d Avoid index-out-of-bounds access when invoking opj_compress with -n 11 or higher. But not a proper fix itself (refs #493) 2017-09-20 00:43:54 +02:00
Even Rouault 8df07d5866 Avoid relying on operator precedence (raised by cppcheck) 2017-09-19 18:35:52 +02:00
Even Rouault c22ea12219 Workaroudn cppcheck (correct) warning about same code in then and else branches 2017-09-19 18:35:31 +02:00
Even Rouault c84e594cff Fix badly named variable in function prototype (raised by cppcheck) 2017-09-19 18:35:07 +02:00
Even Rouault 82ab7effe3 Remove redundant test (raised by cppcheck) 2017-09-19 18:34:49 +02:00
Even Rouault ce8edf9bff Replace C++ style comments by C ones 2017-09-19 18:25:55 +02:00
Even Rouault d415723fd9 Replace C++ style comments by C ones 2017-09-19 18:22:07 +02:00
Even Rouault e17bbde906 opj_set_decoded_components(): add a provision for a apply_color_transforms parameter in case we support it in the future 2017-09-19 17:48:07 +02:00
Even Rouault 7e2b6bebff Add capability to decode only a subset of all components of an image.
This adds a opj_set_decoded_components(opj_codec_t *p_codec,
OPJ_UINT32 numcomps, const OPJ_UINT32* comps_indices) function,
and equivalent "opj_decompress -c compno[,compno]*" option.

When specified, neither the MCT transform nor JP2 channel transformations
will be applied.

Tests added for various combinations of whole image vs tiled-based decoding,
full or reduced resolution, use of decode area or not.
2017-09-19 17:06:19 +02:00
Even Rouault ce199f42e7 src/bin/jp3d/convert.c: add missing fclose() in error code path (#1018) 2017-09-19 12:48:12 +02:00
Even Rouault fdef69b43c Fix warnings and errors when compiling with a c++ compiler (#1021) 2017-09-19 12:46:20 +02:00
Even Rouault 18f6696372 Fix compilation with AppleClang 8.1.0.8020042 (#1020) 2017-09-19 12:13:34 +02:00
Even Rouault 3dfc6ca2bc Build: make sure that -DBUILD_SHARED_LIBS:bool=off is honoured to build only the static lib (#1019) 2017-09-17 12:17:49 +02:00
Even Rouault 28094e1ebf opj_tcd_mct_decode(): avoid heap buffer overflow when components have not the same number of resolutions. Also fixes an issue with subtile decoding. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3331. Credit to OSS Fuzz 2017-09-08 10:56:49 +02:00