Commit Graph

238 Commits

Author SHA1 Message Date
mayeut cd77b6003b Fix some coverity warnings 2016-04-30 12:15:22 +02:00
Matthieu Darbois be42e72d22 Fix warnings (#763) 2016-04-30 01:12:16 +02:00
julienmalik 319fc971fe cppcheck fix for openjp2 (#740) 2016-04-29 23:49:17 +02:00
Matthieu Darbois e166e4a209 Check SSIZ is valid in opj_j2k_read_siz (#762) 2016-04-28 19:20:14 +02:00
Matthieu Darbois 29313eb5f1 Fix unsigned int overflow reported by UBSan (#761)
* Fix unsigned int overflow reported by UBSan

Please add -DOPJ_UBSAN_BUILD to CFLAGS when building with
-fsanitize=undefined,unsigned-integer-overflow

It seems clang/gcc do not allow to disable checking for block of code
other than function or file.
2016-04-28 13:16:43 +02:00
julienmalik e982d03966 Fix implicit float-to-bool conversions (#752) 2016-04-28 11:52:45 +02:00
Antonin Descampe 5c5ae1d51a fixed tile numbering
Fixes #245
2016-01-25 17:30:43 +01:00
Matthieu Darbois a42d03df79 Merge pull request #551 from mayeut/coc-qcc
Add COC/QCC in main header when needed
2016-01-11 00:23:44 +01:00
Stefan Weil 99c4f621bd Fix duplicate article in comments
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-01-06 08:55:29 +01:00
mayeut 80be580d50 Merge branch 'master' into coc-qcc 2015-10-18 03:23:38 +02:00
mayeut 83249c318f Fixed crash on encoding
Update #624
Update #625
2015-10-17 01:30:23 +02:00
mayeut 2dab5fed59 Merge branch 'master' into coc-qcc 2015-10-06 20:55:36 +02:00
Stephan Mühlstrasser d6b51b7041 Added missing casts for return values of opj_malloc()/opj_calloc(). 2015-10-06 15:33:46 +02:00
mayeut db23831d57 Add check for seek support before trying TPsot==TNsot workaround 2015-10-02 22:33:44 +02:00
Stefan Weil 99fc1ab306 Fix typos in comments and string
Most typos were found by codespell.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2015-09-29 05:55:43 +02:00
mayeut 55dbf8acff Fix resource leak in opj_j2k_create_cstr_index
Fixes #599
2015-09-17 12:46:42 +02:00
mayeut c16c91797f Fix resource leak in opj_j2k_encode
Fixes #598
2015-09-17 12:41:41 +02:00
mayeut a4e93c3b0a fix resource leak in opj_j2k_decode_one_tile
Fixes #597
2015-09-17 12:31:18 +02:00
mayeut 66d890bf22 Merge remote-tracking branch 'uclouvain/master' into coc-qcc 2015-09-08 22:33:07 +02:00
mayeut 940100c28a Fix potential use-after-free in opj_j2k_write_mco function
Fixes #563
2015-09-06 17:24:03 +02:00
mayeut 60301842c7 Sync coc-qcc branch with master 2015-07-31 01:07:14 +02:00
mayeut 0df90afdf7 Remove printf/fprintf to stdout/stderr throughout openjp2 lib
Update uclouvain/openjpeg#246
2015-07-30 23:26:31 +02:00
mayeut c3d9719cd4 Write COC/QCC in Main Header
Update uclouvain/openjpeg#459
2015-07-29 00:29:49 +02:00
mayeut 2263b6bacc Start support for qcc/coc 2015-07-28 23:58:10 +02:00
mayeut c423cc84e7 Remove some warnings when building
Update #442
2015-07-26 02:41:39 +02:00
mayeut a56819eaab Add some missing static keywords
Update uclouvain/openjpeg#243
2015-07-23 07:48:42 +02:00
Matthieu Darbois 28c6f54798 Merge pull request #533 from mayeut/refactor-read-ppX
Refactor opj_j2k_read_ppm & opj_j2k_read_ppt
Fixes uclouvain/openjpeg#470
Fixes uclouvain/openjpeg#288
Fixes uclouvain/openjpeg#532
2015-07-21 01:26:02 +02:00
mayeut 0b1f8eb6f7 Merge pull request #529 from renevanderark/master
fix Suspicious code in j2k.c
Fixes #517
2015-07-12 19:20:57 +02:00
mayeut c887df12a3 Refactor opj_read_ppm
Update uclouvain/openjpeg#470
Update uclouvain/openjpeg#288
2015-07-12 18:09:30 +02:00
mayeut d1b053afe2 Refactor opj_j2k_read_ppt
Update uclouvain/openjpeg#470
Update uclouvain/openjpeg#532
2015-07-12 15:55:58 +02:00
mayeut dc43ebf96c Add option to force component splitting in imagetopnm
Update uclouvain/openjpeg#289
2015-07-11 11:35:21 +02:00
Rene van der Ark ba05549b0f fix Suspicious code in j2k.c #517 2015-07-08 11:13:31 +02:00
mayeut c999b6c0f0 uclouvain/openjpeg#254 Add build option to disable the fix 2015-07-04 00:04:55 +02:00
mayeut c7535d084e Merge branch 'master' into issue-254 2015-06-05 20:42:57 +02:00
Matthieu Darbois c0d7afe15c [trunk] Fix offset computations in opj_j2k_update_image_data
Update issue 481
2015-06-03 20:56:13 +00:00
Matthieu Darbois 0fa5a17c98 [trunk] Correct potential double free on malloc failure in opj_j2k_copy_default_tcp_and_create_tcp (fixes issue 492) 2015-05-19 21:57:27 +00:00
Matthieu Darbois 757f9394bf [trunk] Add check for number of layers & cblkw/cblkh values (fixes issue 475) 2015-05-19 21:24:44 +00:00
Matthieu Darbois daed8cc919 [trunk] Add check for at most 1 COD marker per tile. 1 COD marker for MH (fixes issue 476) 2015-05-19 20:13:37 +00:00
mayeut d1a941ea50 Revert "Correct overflows in opj_j2k_update_image_data"
This reverts commit 1fb24aba4b.
2015-05-16 14:22:16 +02:00
mayeut 00a47c1e06 Implement TNsot correction for non conforming files 2015-05-16 11:15:29 +02:00
mayeut 1fb24aba4b Correct overflows in opj_j2k_update_image_data 2015-05-16 02:51:31 +02:00
Antonin Descampe 7a8cdc4bb0 [trunk] fixed a bug encoutntered when multiple MCT markers are provided
Update issue 430
Cc: savmickael@gmail.com
@Mickael: this revision affects your work on custom MCT. Is there a way
you could provide test data to add to our test suite ? Thanks
2015-01-20 16:29:16 +00:00
Matthieu Darbois dde788b59e [trunk] Updated checks regarding number of decomposition levels when compressing
Update  issue 215
2014-12-19 22:56:00 +00:00
Matthieu Darbois 58fc86452d [trunk] Fixed a crash on illegal tile offset when decoding
Update  issue 427
2014-12-18 22:56:38 +00:00
Matthieu Darbois c0cb119c0e [trunk] Fixed a crash on 0xh or wx0 image size decoding
Update  issue 427
2014-12-18 22:19:52 +00:00
Antonin Descampe 8d320bbdf8 [trunk] check number of components when getting mct norm (fixes issue 436) 2014-12-09 12:09:08 +00:00
Matthieu Darbois f57f59b10d [trunk] remove warning during build (fixes issue 435) 2014-11-18 18:30:44 +00:00
Antonin Descampe c3629e37a2 [trunk] significantly reduces memory for single tile RGB encoding (fixes
issue 375)
2014-11-03 14:51:41 +00:00
Antonin Descampe 0a6eaaa605 [trunk] add a check on precinct size (fixes issue 420) 2014-10-30 18:00:45 +00:00
Antonin Descampe 7f8f284ee5 [trunk] prevent overflow in j2k.c
Update issue 392

Issue left open to solve problem on x64-Asan and to investigate Matthieu's suggestion
2014-10-30 11:53:06 +00:00
Antonin Descampe ad4fad0965 [trunk] add a check on mandatory headers in Main Header (fixes issue 408) 2014-10-22 10:30:35 +00:00
Antonin Descampe efb70af001 [trunk] add a check on the number of resolution passed to cmdline (fixes issue 352) 2014-10-21 12:47:48 +00:00
Antonin Descampe 413de4fbfa [trunk] add a check on Zppm value in PPM markers (fixes issue 393) 2014-10-21 12:27:58 +00:00
Antonin Descampe f8796711e8 [trunk] add a check on progression order (fixes issue 413) 2014-10-15 10:14:54 +00:00
Antonin Descampe 0b540067b1 [trunk] add a check for illegal SCod value (fixes issue 400) 2014-10-15 08:48:19 +00:00
Antonin Descampe 3df347eded [trunk] additional checks for marker size inconsistency (fixes issue 363) 2014-10-14 15:15:09 +00:00
Antonin Descampe 7256e43c48 [trunk] fixed PDF crash in Chrome (fixes issue 362) 2014-10-06 21:05:21 +00:00
Antonin Descampe 06bd61b571 [trunk] c++-style comment removed (fixes issue 407) 2014-10-02 07:44:53 +00:00
Antonin Descampe 2720a1a405 [trunk] fixed tile numbering in output message (fixes issue 370) 2014-09-29 12:03:36 +00:00
Antonin Descampe 6868ee373e added memory allocation checks (fixes issue 355) 2014-09-19 10:26:35 +00:00
Antonin Descampe 50a205d20f [trunk] improve memory management (fixes issue 359) 2014-09-16 15:48:04 +00:00
Antonin Descampe 2c810567dd [trunk] Changed error to warning when no EOC found in codestream (fixes
issue 366)
2014-07-14 07:42:50 +00:00
Antonin Descampe 0a1a29a7fe [trunk] replaced malloc with opj_malloc. (Fixes issue 368). 2014-07-03 16:05:56 +00:00
Antonin Descampe 7d21871ed8 [trunk] fixes issue #357. MCT is automatically disabled when
subsamppling is detected.
2014-07-03 09:15:13 +00:00
Antonin Descampe a38b97fae0 [trunk] moved comment marker setup from opj_compress to the library 2014-07-01 13:51:55 +00:00
Antonin Descampe 45313a8dfa [trunk] fixed warning in j2k.c about sign conversion 2014-04-28 09:38:44 +00:00
Antonin Descampe 08c09b74cf [trunk]formatted some messages. Removed -version option to disambiguate
with -v(erbose) option, added version info in help display
2014-04-23 09:12:30 +00:00
Antonin Descampe 7aece5e8e7 [trunk]Replaced deprecated opj_stream_set_user_data function from API
with its 'v3' version, and removed all other 'v3' suffixes from API.
2014-04-23 07:46:11 +00:00
Antonin Descampe 7199d9b5d3 [trunk] refactoring of rsiz, profiles, and extensions management 2014-04-17 09:31:37 +00:00
Antonin Descampe d19a4ab676 [trunk] updated copyright and added copyright notice required by ISO, in each file; updated AUTHORS, NEWS 2014-04-03 15:30:57 +00:00
Mathieu Malaterre 79d18f7fd0 [trunk] Now that dataset from issue 297 have been imported, run test suite.
None of the dataset triggered any buffer overflow. Recent changes in trunk handle all those cases.
Update issue 297
2014-03-18 10:21:11 +00:00
Mathieu Malaterre 7e1d012161 [trunk] Now that issue 165 dataset is in non regression repository, activate code to reject them
Fixes issue 165
2014-03-14 15:01:13 +00:00
Mathieu Malaterre e8abf1fb25 [trunk] Add internal implementation to dump all tiles/comp info
Eg: opj_dump -f 8 -i input.j2k
Update issue 3
2014-03-14 13:53:36 +00:00
Mathieu Malaterre b7fe7d25e1 [trunk] Prevent a leak when reading PPT markers
Update issue 295
2014-03-14 12:27:01 +00:00
Mathieu Malaterre 6e22c4f68a [trunk] Add some sanity checks when reading Ippm(i) segments
Update issue 288
2014-03-13 15:34:36 +00:00
Mathieu Malaterre 565ef29ae3 [trunk] Make sure to reallocate ppm data buffer when multiple Ippm(i) buffer are found
This handle the case where remaining data is exactly Nppm(i)
Fixes issue 287
2014-03-13 13:47:44 +00:00
Mathieu Malaterre fe100fb490 [trunk] Add debug code to extract decompressed image right before PCLR handling
Update issue 235
2014-03-13 10:35:41 +00:00
Mathieu Malaterre 6b51d11d08 [trunk] Make sure when reading POC that number of layers (layer end) is within acceptable bound.
Fixes issue 80
2014-03-12 10:10:21 +00:00
Mathieu Malaterre db82cf7778 [trunk] Add debug info to track issue 80
Update issue 80
2014-03-11 15:17:39 +00:00
Mathieu Malaterre 76557d2eb3 [trunk] Another round of fixes for sign conversion warnings.
Update issue 256
2014-03-10 15:51:05 +00:00
Mathieu Malaterre c02c1432e8 [trunk] Remove a set of warning about sign conversion
Update issue 266
2014-03-10 14:15:27 +00:00
Mathieu Malaterre 37128c34a9 [trunk] Fix mem leaks reported by cppcheck 2014-03-07 08:48:47 +00:00
Mathieu Malaterre 6790587db8 [trunk] Revert r2597 for now, since it breaks a lot of tests 2014-03-06 17:25:08 +00:00
Mathieu Malaterre 445f696dc6 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 16:59:34 +00:00
Mathieu Malaterre 0f45e38b52 [trunk] Remove warning about sign conversion.
Update issue 256
2014-03-06 16:26:24 +00:00
Mathieu Malaterre f7da94610d [trunk] Remove some conversion warnings reported by gcc
Update issue 256
2014-03-04 09:55:38 +00:00
Mathieu Malaterre a68a3feb60 [trunk] Remove deprecated functions (not called anywhere in the code base).
Update issue 268
2014-03-03 08:17:20 +00:00
Mathieu Malaterre 2c876b6765 [trunk] Remove simple warnings about comments, missing case in switch statement 2014-03-02 10:16:54 +00:00
Mathieu Malaterre c53e2960a0 [trunk] Remove easy uint32 <-> int32 conversions 2014-02-28 16:01:07 +00:00
Mathieu Malaterre cf91ebf278 [trunk] Re-import chunk from r2458 that made textGBR.jp2 to fail otherwise
Update issue 225
2014-02-28 15:27:30 +00:00
Mathieu Malaterre fd5f21af00 [trunk] Rework r2458, instead we should reject 451.pdf.SIGSEGV.ce9.3723 since tile-parts are out of order (as per kakadu behavior).
Update issue 225
2014-02-28 15:24:33 +00:00
Mathieu Malaterre fc855084a0 [trunk] Really apply r2460 this time, but fix the original typo in the submitted patch
Update issue 225
2014-02-28 14:52:58 +00:00
Mathieu Malaterre 8a4095b405 [trunk] add a sentinel in debug code 2014-02-27 09:56:06 +00:00
Mathieu Malaterre 3fe9243e1c [trunk] revert r2460 since it breaks ETS-C1P0-p0_03.j2k-decode.
Update issue 225
2014-02-26 12:33:49 +00:00
Mathieu Malaterre 19887b7b8c [trunk] Import patch from sumatrapdf team. This handle testcase 2977.pdf.asan.67.2198
Update issue 225
2014-02-26 11:17:18 +00:00
Mathieu Malaterre 005e75bdc3 [trunk] Import (ugly) patch from sumatrapdf team. This feels like a hack rather than a solution.
Fixes issue 226
2014-02-26 11:16:32 +00:00
Mathieu Malaterre 5f3470fcd0 [trunk] Import patch from sumatrapdf team. This handle testcase 3635.pdf.asan.77.2930
Update issue 225
2014-02-26 11:14:27 +00:00
Mathieu Malaterre adb237cfa8 [trunk] Import patch from sumatrapdf team. Original commit is 5b0c9985e3359aca9b3fcfd94424166aa61a141a.
Update issue 225
2014-02-26 11:13:21 +00:00
Mathieu Malaterre 29a29d6210 [trunk] Import patch from sumatrapdf team. This handle testcase 451.pdf.SIGSEGV.ce9.3723
Update issue 225
2014-02-26 11:11:33 +00:00
Mathieu Malaterre 3a155ceda6 [trunk] Import patch from sumatrapdf team. This handle testcase 2.pdf.SIGFPE.706.1112
Update issue 225
2014-02-26 11:10:40 +00:00
Mathieu Malaterre 7195a23a9d [trunk] Import patch from sumatrapdf team. This handle testcase 1610.pdf.SIGSEGV.59c.681
Update issue 225
2014-02-26 11:09:59 +00:00
Mathieu Malaterre 0ae6ff8018 [trunk] Import patch from sumatrapdf team. This handle testcase 2539.pdf.SIGFPE.706.1712
Update issue 225
2014-02-26 11:09:20 +00:00
Mathieu Malaterre 241769dc2f [trunk] Import patch from sumatrapdf team. This handle testcase 4035.pdf.SIGSEGV.d8b.3375
Update issue 225
2014-02-26 11:08:25 +00:00
Antonin Descampe e826e9281e [trunk] replaced fprintf with event_mgr in cinema-related stuff in j2k.c 2014-02-12 16:33:19 +00:00
Antonin Descampe 780120c9a2 [trunk] moved logic related to cinema profiles in library (was in
opj_compress.c). This enables one using the library with its own
executable to easily ask for cinema profiles.
2014-02-12 16:16:21 +00:00
Antonin Descampe ee3f2ffa19 [trunk] fixed several bugs in cinema mode (2K 24/48 fps, and 4K). Trunk
now produces compliant DCI code-streams.
2014-01-22 18:41:34 +00:00
Antonin Descampe 7b14cf8558 [trunk] fixed DCI-compliant codestream generation (-cinema2K and - 2014-01-16 12:55:14 +00:00
Mickael Savinaud 07ae149955 [trunk] managed nicely the case where TPSot value is incorrect (thanks winfried). Update the test suite to check this case. Updates issue 202. Updates issue 206. Update issue 208 2013-03-24 22:50:46 +00:00
Mickael Savinaud 59582bafa3 [trun[trunk] check if the dx and dy steps are not incorrect according to the JPEG2000 norm (thanks Even).
Test associated to this issue should nicely fail. Fixes issue 194
2012-11-26 16:24:29 +00:00
Mickael Savinaud 1ad85ac9ee [trunk] check if the number of tiles is not incorrect regarding the JPEG2000 norm (thanks Even).
Test associated to this issue should nicely fail. Fixes issue 163
2012-11-26 16:13:32 +00:00
Mickael Savinaud 48e0d167aa [trunk] check the index of the component in read_qcc (thanks Even). fixes issue 192 2012-11-26 15:58:14 +00:00
Mickael Savinaud f14da66ce5 [trunk] update test suite with issue 191 to 194 and update patch for 191 which should fail properly 2012-11-26 13:37:33 +00:00
Mickael Savinaud 14ab311d2f [trunk] fix issue 191 (thanks Even) 2012-11-19 13:37:04 +00:00
Mickael Savinaud fcf9fa3651 [trunk] add opj_ prefix to some internal define and use the new opj type instead of int and float in some files 2012-11-16 08:29:43 +00:00
Mickael Savinaud 8eb481b6c6 [trunk] add an assert to spot a problem. update issue 189 2012-11-15 16:28:44 +00:00
Mickael Savinaud d5efeb7df5 [trunk]update the copyright, the authors and thanks to respect the license 2012-11-15 15:22:29 +00:00
Mickael Savinaud ec0fe09138 [trunk] move opj_bool to OPJ_BOOL to follow the other type 2012-11-15 13:13:36 +00:00
Mickael Savinaud 21b0ccf859 [trunk] rename public symbols with OPJ_ prefix (enum part) 2012-11-15 12:58:32 +00:00
Mickael Savinaud 84c93c2fea [trunk] rename public symbols with OPJ_ prefix 2012-11-15 12:25:11 +00:00
Mickael Savinaud 0e3c467a5b [trunk] remove warnings raised by vs11-beta analyzer 2012-11-13 16:59:03 +00:00
Mickael Savinaud 7307bb6e9a [trunk] remove warnings raised by flags -Wall -Wextra -pedantic and vs9 analyzer 2012-11-13 15:16:35 +00:00
Mickael Savinaud 4263410fe8 [trunk] remove warnings raised by flags -Wall -Wextra -pedantic 2012-11-13 12:59:35 +00:00
Mickael Savinaud cb0eb855ca [trunk] manage the case where the SOT marker is alone, PSot=12 (case of PHR data).
Fixes  issue 162
2012-11-13 11:18:58 +00:00
Mickael Savinaud 18e7fcc37f [trunk] remove warnings related to the use of -Wall -Wextra -pedantic 2012-10-29 10:08:35 +00:00
Mickael Savinaud bcc386e3bb [trunk]remove some warnings raised by Wall 2012-10-26 09:39:52 +00:00
Mickael Savinaud 9b6900b058 [trunk] [trunk] remove old opj_tcp and rename opj_tcp_v2 to opj_tcp 2012-10-25 15:15:02 +00:00
Mickael Savinaud 7f7ef068fc [trunk] [trunk] remove old opj_cp and rename opj_cp_v2 to opj_cp 2012-10-25 15:09:31 +00:00
Mickael Savinaud 06615a556d [trunk] rename opj_tcd_truct_v2 to opj_tcd_struct 2012-10-25 14:49:10 +00:00
Mickael Savinaud 94a69c2b31 [trunk] rename opj_j2k_v2 to opj_j2k 2012-10-25 14:27:09 +00:00
Mickael Savinaud 668484ba8f [trunk] correct a mis use of an old struct 2012-10-25 14:10:01 +00:00
Mickael Savinaud f824078c14 [trunk] rename opj_event_msg_v2 to opj_event_msg 2012-10-25 13:49:20 +00:00
Mathieu Malaterre f3d7d2f7b1 [trunk] Rework r2077
r2077 did expose too much of the detail implementation of OpenJPEG. Rework dependencies in between JPIP file level details and JPIP client/server arch.
Move JPIP file level functionalities back into OpenJP2 as was the case in openjpeg 1.5.x. Use new cio func.
2012-10-25 07:39:59 +00:00
Mickael Savinaud 76947f0074 [trunk] add the support of complex mct encoding when we setup the j2k encoder 2012-10-24 15:19:51 +00:00
Mathieu Malaterre dff377a741 [trunk] Fix compilation:
- using mingw32 compiler (missing exported symbols)
- using -fvisibility=hidden (gcc on UNIX)
2012-10-15 09:44:34 +00:00
Mathieu Malaterre eda4c26d24 [trunk] Fix spelling. writting -> writing 2012-10-05 09:20:05 +00:00
Mickael Savinaud 4b140e060b [trunk] rename int.h to opj_intmath.h and rename all its functions with opj_ prefix 2012-10-05 09:10:15 +00:00
Mickael Savinaud 6c4024796e [trunk]rename pi_update_encoding_parameters to opj_pi_update_encoding_parameters 2012-10-03 12:50:44 +00:00
Mathieu Malaterre d518970039 [trunk] Start FolderReorgProposal task
Update issue 177
2012-09-28 08:11:41 +00:00