Compare commits

...

64 Commits

Author SHA1 Message Date
Antonin Descampe a972501658 update abi-check 2016-09-29 22:19:43 +02:00
Antonin Descampe 9a9bc8fa60 remove opj 1.4 and 1.2 from abi-check to avoid symlinks in gh-pages 2016-09-28 20:53:59 +02:00
Antonin Descampe 01e64bd868 Update abi-check scripts for v2.1.2 2016-09-28 20:33:31 +02:00
Antonin Descampe 1f1e968269 Update NEWS.md for v2.1.2 2016-09-28 20:18:16 +02:00
Antonin Descampe 54941adbee Update Changelog for v2.1.2 2016-09-28 20:18:16 +02:00
Antonin Descampe 4142ac60d6 Update version number 2016-09-28 18:53:41 +02:00
Mathieu Malaterre ac927f2eee OPENJPEG_NAMESPACE is configurable by user 2016-09-26 12:02:22 +02:00
Mathieu Malaterre 1be0128fab Remove typos from comments and man pages 2016-09-26 11:28:44 +02:00
Matthieu Darbois f053508f6f Fix PNM file reading (#847)
Malformed PNM file could cause a crash in opj_compress.
Checks were added to prevent this.

Fixes #843
Updates #440
2016-09-22 08:16:36 +02:00
Stefan Weil 7a5fb35b8d Fix some issues reported by Coverity Scan (#846)
* test_tile_decoder: Fix potential buffer overflow (coverity)

CID 1190155 (#1 of 1): Unbounded source buffer (STRING_SIZE)

Using a pointer instead of buffer of fixed size avoids the limit
for the length of the input file name.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* test_tile_encoder: Fix potential buffer overflow (coverity)

CID 1190154 (#1 of 1): Unbounded source buffer (STRING_SIZE)

Using a pointer instead of buffer of fixed size avoids the limit
for the length of the output file name. This implies that the length
can exceed 255, so the data type for variable len had to be fixed, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* openjpip: Initialize data before returning it

This fixes an error reported by Coverity:

CID 1190143 (#1 of 1): Uninitialized scalar variable (UNINIT)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-22 08:16:13 +02:00
Stefan Weil 39f9934a70 Fix potential out-of-bounds read (coverity) (#844)
* query_parser: Fix potential out-of-bounds read (coverity)

CID 1190207 (#1 of 1): Out-of-bounds read (OVERRUN)

Variable i must be checked before testing query_param.box_type.

Signed-off-by: Stefan Weil <sw@weilnetz.de>

* jpip_parser: Fix potential out-of-bounds read (coverity)

CID 1190206 (#1 of 1): Out-of-bounds read (OVERRUN)

Variable i must be checked before testing query_param.box_type.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-21 14:11:35 +02:00
Antonin Descampe 04a00aab65 Merge pull request #834 from trylab/issue833
Fix issue 833.
2016-09-20 19:04:49 +02:00
Antonin Descampe b7d73d7b25 Disable automatic compilation of t1_generate_luts
Fix #831
2016-09-20 18:51:35 +02:00
Antonin Descampe 25966346f7 Fix warnings from recent overflow checks
see #832
2016-09-16 17:48:20 +02:00
Antonin Descampe d8ae42d808 Merge pull request #832 from mayeut/overflow-check
Add overflow checks for opj_aligned_malloc
2016-09-15 11:12:58 +02:00
mayeut 43557dcd3b Add overflow checks for opj_aligned_malloc
See
https://pdfium.googlesource.com/pdfium/+/b20ab6c7acb3be1393461eb650ca8fa
4660c937e/third_party/libopenjpeg20/0020-opj_aligned_malloc.patch
2016-09-13 21:05:30 +02:00
Matthieu Darbois 0b7aad3231 Add test for issue 820 (#829)
Update uclouvain/openjpeg#820
2016-09-13 11:00:09 +02:00
Matthieu Darbois 5e58b30b8b Add test for issue 826 (#827)
Update uclouvain/openjpeg#826

Also correct names for data of issue uclouvain/openjpeg#823
2016-09-13 11:00:09 +02:00
Matthieu Darbois ee458b5fd0 Fix coverity 113065 (CWE-484) (#824) 2016-09-13 11:00:08 +02:00
Antonin Descampe 21a02aa5be Update THANKS.md 2016-09-13 11:00:08 +02:00
Matthieu Darbois bf845a3892 Cast to size_t before multiplication
Need to cast to size_t before multiplication otherwise overflow check is useless.
2016-09-13 11:00:08 +02:00
Matthieu Darbois b75acb3bb9 Add sanity check for tile coordinates (#823)
Coordinates are casted from OPJ_UINT32 to OPJ_INT32
Add sanity check for negative values and upper bound becoming lower
than lower bound.
See also
https://pdfium.googlesource.com/pdfium/+/b6befb2ed2485a3805cddea86dc7574510178ea9
2016-09-13 11:00:08 +02:00
Matthieu Darbois 2978541ea2 Add test for PR 818 (#822)
update uclouvain/openjpeg#818
2016-09-13 11:00:08 +02:00
Matthieu Darbois 53b4bf29ca fix incrementing of "l_tcp->m_nb_mcc_records" in opj_j2k_read_mcc (#820) 2016-09-13 11:00:08 +02:00
trylab 5196bda0b9 Fix an integer overflow issue (#809)
Prevent an integer overflow issue in function opj_pi_create_decode of
pi.c.
2016-09-13 11:00:08 +02:00
Matthieu Darbois 3547402709 Add overflow check in opj_tcd_init_tile (#819) 2016-09-13 11:00:08 +02:00
Matthieu Darbois d60b7aa130 Fix leak & invalid behavior of opj_jp2_read_ihdr (#818)
In case multiple ihdr box are present, only the first one shall be
taken into account.
2016-09-13 11:00:08 +02:00
Matthieu Darbois 98a97cef6b Add overflow check in opj_j2k_update_image_data (#817) 2016-09-13 11:00:08 +02:00
Matthieu Darbois c8fbf0f516 Change 'restrict' define to 'OPJ_RESTRICT' (#816)
Visual Studio 2015 does not pass regression tests with `__restrict` so kept disabled for MSVC.
Need to check proper usage of OPJ_RESTRICT (if correct then there’s
probably a bug  in vc14)

Closes #661
2016-09-13 11:00:07 +02:00
Stefan Weil 4d2527aa61 Add .gitignore (#787)
Ignore all files and directories which are generated by `cmake . && make`.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-13 11:00:07 +02:00
Matthieu Darbois f62b810892 Switch to clang 3.8 (#814)
clang 3.9 is currently unavailable for precise through apt
2016-09-13 11:00:07 +02:00
Matthieu Darbois 4daf9a8d88 Reenable clang-3.9 build on travis (#806)
clang-3.9 is now available with apt add-on in travis-ci
2016-09-13 11:00:07 +02:00
Matthieu Darbois f31c327213 Add compilation test for standalone inclusion of openjpeg.h (#798)
This ensures all openjpeg.h dependencies are met.
Fix #673
2016-09-13 11:00:07 +02:00
Stefan Weil eebd59a6d6 jpwl: Remove non-portable data type u_int16_t (fix issue #796) (#797)
The type casts which used this data type can be removed by changing
the signature of function swap16. As this function is called with
unsigned variables, this change is reasonable.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-13 11:00:07 +02:00
Stefan Weil ae2095ef14 Fix dependency for pkg-config (issue #594) (#795)
openjpeg provides libopenjp2.pc, so the require statements must refer to
libopenjp2 instead of openjp2.
Fixes #594

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-09-13 11:00:07 +02:00
mayeut 37b1679a27 Update ABI tracker script
Disable previous version.
2016-09-13 11:00:07 +02:00
mayeut 0fac6e4222 Update ABI tracker from 2.1 to 2.1.1 2016-09-13 11:00:07 +02:00
Antonin Descampe 76fa5c5639 update api/abi tracker 2016-09-13 11:00:07 +02:00
mayeut 6221641a2c Add version 2.1.1 to ABI tracker 2016-09-13 11:00:06 +02:00
Antonin Descampe 0a2178fa27 Trigger API/ABI update on website 2016-09-13 11:00:06 +02:00
Antonin Descampe 53f25200ed Merge branch 'master' into openjpeg-2.1 2016-07-05 16:54:17 +02:00
Antonin Descampe 788dff0a36 Merge branch 'master' into openjpeg-2.1 2016-05-15 19:19:15 +02:00
Antonin Descampe 5a0620026f Update appveyor release description 2016-05-15 18:00:07 +02:00
Antonin Descampe 620b06f566 Fixing deployment condition 2016-05-15 17:38:18 +02:00
Antonin Descampe b3a8a69503 cpack only on tag commit 2016-05-15 16:52:17 +02:00
Antonin Descampe 5b9bf39408 Trying to make appveyor and travis deploy on the same release 2016-05-15 16:51:21 +02:00
Antonin Descampe 65e214efd3 WIP automatic deployment 2016-05-15 16:09:45 +02:00
Antonin Descampe e0d2a7bd8c WIP automatic deployment 2016-05-15 16:01:20 +02:00
Antonin Descampe 177fdd94c0 WIP automatic deployment 2016-05-15 14:18:14 +02:00
Antonin Descampe a091186825 WIP automatic deployment 2016-05-15 14:02:44 +02:00
Antonin Descampe 517d57ef1f WIP automatic deployment 2016-05-15 13:52:55 +02:00
Antonin Descampe 7c41a1e393 WIP automatic deployment 2016-05-15 13:38:32 +02:00
Antonin Descampe 7269c8f7a6 WIP automatic deployment 2016-05-15 13:15:01 +02:00
Antonin Descampe a66c391519 WIP automatic release (debugging run.sh) 2016-05-15 02:19:03 +02:00
Antonin Descampe 9c8ab8bd2e Revert LICENSE filename 2016-05-15 02:09:54 +02:00
Antonin Descampe 595f0e1b2b WIP automatic release (ctd) 2016-05-15 02:03:13 +02:00
Antonin Descampe 7219854639 WIP automatic release 2016-05-15 01:36:31 +02:00
Antonin Descampe 9466d3100e Merge branch 'master' into openjpeg-2.1 2016-05-15 01:11:44 +02:00
Antonin Descampe 58320d2f3b Merge branch 'master' into openjpeg-2.1 2016-05-13 12:05:59 +02:00
Antonin Descampe 5611209f12 Update README.md 2016-01-25 22:37:31 +01:00
Antonin Descampe 5ce71e1ec9 Uploaded current compatibility report with 2.1.0 release 2016-01-25 18:15:48 +01:00
Antonin Descampe 9701c19323 Merge branch 'master' into openjpeg-2.1 2016-01-25 17:55:01 +01:00
Antonin Descampe c84747e580 Merge branch 'master' into openjpeg-2.1 2016-01-23 19:51:16 +01:00
Mathieu Malaterre cf77ede84c [2.1] Create the 2.1 branch 2014-04-29 06:58:23 +00:00
43 changed files with 965 additions and 281 deletions

17
.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# Ignore files and directories made by `cmake .`.
CMakeFiles/
Makefile
cmake_install.cmake
/CMakeCache.txt
/CPackConfig.cmake
/CPackSourceConfig.cmake
/CTestCustom.cmake
/LICENSE.txt
/OpenJPEGConfig.cmake
/libopenjp2.pc
/src/bin/common/opj_apps_config.h
/src/lib/openjp2/opj_config.h
/src/lib/openjp2/opj_config_private.h
# Ignore directories made by `make`.
/bin/

View File

@ -21,6 +21,16 @@ matrix:
- os: linux
compiler: clang
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1
- os: linux
compiler: clang-3.8
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
sources:
- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
- clang-3.8
- os: linux
compiler: x86_64-w64-mingw32-gcc
env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release

View File

@ -1,5 +1,60 @@
# Changelog
## [v2.1.2](https://github.com/uclouvain/openjpeg/releases/v2.1.2) (2016-09-28)
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/v2.1.1...v2.1.2)
**Closed issues:**
- null ptr dereference in convert.c:1331 [\#843](https://github.com/uclouvain/openjpeg/issues/843)
- Out-of-Bounds Read in function bmp24toimage of convertbmp.c [\#833](https://github.com/uclouvain/openjpeg/issues/833)
- Disable automatic compilation of t1\_generate\_luts in CMakeLists.txt [\#831](https://github.com/uclouvain/openjpeg/issues/831)
- CVE-2016-7163 Integer overflow in opj\_pi\_create\_decode [\#826](https://github.com/uclouvain/openjpeg/issues/826)
- Security Advisory for OpenJPEG [\#810](https://github.com/uclouvain/openjpeg/issues/810)
- Add dashboard with static lib [\#804](https://github.com/uclouvain/openjpeg/issues/804)
- hidden visibility for the static library / building with -DOPJ\_STATIC against shared lib [\#802](https://github.com/uclouvain/openjpeg/issues/802)
- Optimization when building library from source [\#799](https://github.com/uclouvain/openjpeg/issues/799)
- unsigned int16 on Solaris 11.2/sparc [\#796](https://github.com/uclouvain/openjpeg/issues/796)
- appveyor [\#793](https://github.com/uclouvain/openjpeg/issues/793)
- Please make a new release [\#782](https://github.com/uclouvain/openjpeg/issues/782)
- FFMpeg will not link to 2.1.1 release built as shared library [\#766](https://github.com/uclouvain/openjpeg/issues/766)
- API change since v2: opj\_event\_mgr\_t not available [\#754](https://github.com/uclouvain/openjpeg/issues/754)
- openjpeg.h needs dependencies [\#673](https://github.com/uclouvain/openjpeg/issues/673)
- "master" does not build on ubuntu [\#658](https://github.com/uclouvain/openjpeg/issues/658)
- Package 'openjp2', required by 'libopenjpip', not found [\#594](https://github.com/uclouvain/openjpeg/issues/594)
**Merged pull requests:**
- Fix PNM file reading [\#847](https://github.com/uclouvain/openjpeg/pull/847) ([mayeut](https://github.com/mayeut))
- Fix some issues reported by Coverity Scan [\#846](https://github.com/uclouvain/openjpeg/pull/846) ([stweil](https://github.com/stweil))
- Fix potential out-of-bounds read \(coverity\) [\#844](https://github.com/uclouvain/openjpeg/pull/844) ([stweil](https://github.com/stweil))
- Remove TODO for overflow check [\#842](https://github.com/uclouvain/openjpeg/pull/842) ([mayeut](https://github.com/mayeut))
- Add overflow checks for opj\_aligned\_malloc [\#841](https://github.com/uclouvain/openjpeg/pull/841) ([mayeut](https://github.com/mayeut))
- Flags in T1 shall be unsigned [\#840](https://github.com/uclouvain/openjpeg/pull/840) ([mayeut](https://github.com/mayeut))
- Fix some warnings [\#838](https://github.com/uclouvain/openjpeg/pull/838) ([mayeut](https://github.com/mayeut))
- Fix issue 833. [\#834](https://github.com/uclouvain/openjpeg/pull/834) ([trylab](https://github.com/trylab))
- Add overflow checks for opj\_aligned\_malloc [\#832](https://github.com/uclouvain/openjpeg/pull/832) ([mayeut](https://github.com/mayeut))
- Add test for issue 820 [\#829](https://github.com/uclouvain/openjpeg/pull/829) ([mayeut](https://github.com/mayeut))
- Add test for issue 826 [\#827](https://github.com/uclouvain/openjpeg/pull/827) ([mayeut](https://github.com/mayeut))
- Fix coverity 113065 \(CWE-484\) [\#824](https://github.com/uclouvain/openjpeg/pull/824) ([mayeut](https://github.com/mayeut))
- Add sanity check for tile coordinates [\#823](https://github.com/uclouvain/openjpeg/pull/823) ([mayeut](https://github.com/mayeut))
- Add test for PR 818 [\#822](https://github.com/uclouvain/openjpeg/pull/822) ([mayeut](https://github.com/mayeut))
- Update to libpng 1.6.25 [\#821](https://github.com/uclouvain/openjpeg/pull/821) ([mayeut](https://github.com/mayeut))
- fix incrementing of "l\_tcp-\>m\_nb\_mcc\_records" in opj\_j2k\_read\_mcc [\#820](https://github.com/uclouvain/openjpeg/pull/820) ([mayeut](https://github.com/mayeut))
- Add overflow check in opj\_tcd\_init\_tile [\#819](https://github.com/uclouvain/openjpeg/pull/819) ([mayeut](https://github.com/mayeut))
- Fix leak & invalid behavior of opj\_jp2\_read\_ihdr [\#818](https://github.com/uclouvain/openjpeg/pull/818) ([mayeut](https://github.com/mayeut))
- Add overflow check in opj\_j2k\_update\_image\_data [\#817](https://github.com/uclouvain/openjpeg/pull/817) ([mayeut](https://github.com/mayeut))
- Change 'restrict' define to 'OPJ\_RESTRICT' [\#816](https://github.com/uclouvain/openjpeg/pull/816) ([mayeut](https://github.com/mayeut))
- Switch to clang 3.8 [\#814](https://github.com/uclouvain/openjpeg/pull/814) ([mayeut](https://github.com/mayeut))
- Fix an integer overflow issue [\#809](https://github.com/uclouvain/openjpeg/pull/809) ([trylab](https://github.com/trylab))
- Update to lcms 2.8 [\#808](https://github.com/uclouvain/openjpeg/pull/808) ([mayeut](https://github.com/mayeut))
- Update to libpng 1.6.24 [\#807](https://github.com/uclouvain/openjpeg/pull/807) ([mayeut](https://github.com/mayeut))
- Reenable clang-3.9 build on travis [\#806](https://github.com/uclouvain/openjpeg/pull/806) ([mayeut](https://github.com/mayeut))
- Bit fields type [\#805](https://github.com/uclouvain/openjpeg/pull/805) ([smuehlst](https://github.com/smuehlst))
- Add compilation test for standalone inclusion of openjpeg.h [\#798](https://github.com/uclouvain/openjpeg/pull/798) ([mayeut](https://github.com/mayeut))
- jpwl: Remove non-portable data type u\_int16\_t \(fix issue \#796\) [\#797](https://github.com/uclouvain/openjpeg/pull/797) ([stweil](https://github.com/stweil))
- Fix dependency for pkg-config \(issue \#594\) [\#795](https://github.com/uclouvain/openjpeg/pull/795) ([stweil](https://github.com/stweil))
- Add .gitignore [\#787](https://github.com/uclouvain/openjpeg/pull/787) ([stweil](https://github.com/stweil))
## [v2.1.1](https://github.com/uclouvain/openjpeg/releases/tag/v2.1.1) (2016-07-05)
[Full Changelog](https://github.com/uclouvain/openjpeg/compare/version.2.1...v2.1.1)

View File

@ -33,7 +33,7 @@ include_regular_expression("^.*$")
# OPENJPEG version number, useful for packaging and doxygen doc:
set(OPENJPEG_VERSION_MAJOR 2)
set(OPENJPEG_VERSION_MINOR 1)
set(OPENJPEG_VERSION_BUILD 1)
set(OPENJPEG_VERSION_BUILD 2)
set(OPENJPEG_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
set(PACKAGE_VERSION
@ -53,6 +53,7 @@ set(PACKAGE_VERSION
# 2.0.1 | 6
# 2.1 | 7
# 2.1.1 | 7
# 2.1.2 | 7
# above is the recommendation by the OPJ team. If you really need to override this default,
# you can specify your own OPENJPEG_SOVERSION at cmake configuration time:
# cmake -DOPENJPEG_SOVERSION:STRING=42 /path/to/openjpeg
@ -67,7 +68,7 @@ set(OPENJPEG_LIBRARY_PROPERTIES
# --------------------------------------------------------------------------
# Path to additional CMake modules
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})
# --------------------------------------------------------------------------
@ -163,8 +164,8 @@ TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN)
#-----------------------------------------------------------------------------
# Setup file for setting custom ctest vars
configure_file(
${CMAKE_SOURCE_DIR}/cmake/CTestCustom.cmake.in
${CMAKE_BINARY_DIR}/CTestCustom.cmake
${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/CTestCustom.cmake.in
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/CTestCustom.cmake
@ONLY
)
@ -226,7 +227,7 @@ CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
include(TestLargeFiles)
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
# Allocating Aligned Memory Blocks
# Allocating Aligned Memory Blocks
include(CheckIncludeFiles)
check_include_files(malloc.h OPJ_HAVE_MALLOC_H)
include(CheckSymbolExists)
@ -249,6 +250,7 @@ if(BUILD_JPIP_SERVER)
endif()
endif()
add_subdirectory(src/lib)
option(BUILD_LUTS_GENERATOR "Build utility to generate t1_luts.h" OFF)
#-----------------------------------------------------------------------------
# Build Applications
@ -322,8 +324,8 @@ endif()
#-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets
install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
configure_file( ${OPENJPEG_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake
configure_file( ${${OPENJPEG_NAMESPACE}_SOURCE_DIR}/cmake/OpenJPEGConfig.cmake.in
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/OpenJPEGConfig.cmake
@ONLY
)
install( FILES ${OPENJPEG_BINARY_DIR}/OpenJPEGConfig.cmake

View File

@ -2,6 +2,11 @@
More details in the [Changelog](https://github.com/uclouvain/openjpeg/blob/master/CHANGELOG.md)
## OpenJPEG 2.1.2
* Bug fixes (including security fixes)
* No API/ABI break compared to v2.1.1
## OpenJPEG 2.1.1
* Huge amount of critical bugfixes

View File

@ -1,7 +1,7 @@
# OPENJPEG Library and Applications
## What is OpenJPEG ?
## What is OpenJPEG ?
OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of [JPEG 2000](http://www.jpeg.org/jpeg2000), a still-image compression standard from the Joint Photographic Experts Group ([JPEG](http://www.jpeg.org)). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a [JPEG 2000 Reference Software](http://www.itu.int/rec/T-REC-T.804-201504-I!Amd2).
@ -73,10 +73,10 @@ API available is the one supported by OpenJPEG.
[comment-license]: https://img.shields.io/github/license/uclouvain/openjpeg.svg "https://img.shields.io/badge/license-BSD--2--Clause-blue.svg"
[badge-license]: https://img.shields.io/badge/license-BSD--2--Clause-blue.svg "BSD 2-clause "Simplified" License"
[link-license]: https://github.com/uclouvain/openjpeg/blob/master/LICENSE "BSD 2-clause "Simplified" License"
[badge-build]: https://travis-ci.org/uclouvain/openjpeg.svg?branch=master "Build Status"
[badge-build]: https://travis-ci.org/uclouvain/openjpeg.svg?branch=openjpeg-2.1 "Build Status"
[link-build]: https://travis-ci.org/uclouvain/openjpeg "Build Status"
[badge-msvc-build]: https://ci.appveyor.com/api/projects/status/github/uclouvain/openjpeg?branch=master&svg=true "Windows Build Status"
[link-msvc-build]: https://ci.appveyor.com/project/detonin/openjpeg/branch/master "Windows Build Status"
[badge-msvc-build]: https://ci.appveyor.com/api/projects/status/github/uclouvain/openjpeg?branch=openjpeg-2.1&svg=true "Windows Build Status"
[link-msvc-build]: https://ci.appveyor.com/project/detonin/openjpeg/branch/openjpeg-2.1 "Windows Build Status"
[badge-coverity]: https://scan.coverity.com/projects/6383/badge.svg "Coverity Scan Build Status"
[link-coverity]: https://scan.coverity.com/projects/uclouvain-openjpeg "Coverity Scan Build Status"
[link-api-timeline]: http://www.openjpeg.org/abi-check/timeline/openjpeg "OpenJPEG API/ABI timeline"

View File

@ -4,34 +4,35 @@ Many people have contributed to OpenJPEG by reporting problems, suggesting vario
or submitting actual code. Here is a list of these people. Help me keep
it complete and exempt of errors.
Giuseppe Baruffa
Ben Boeckel
Aaron Boxer
David Burken
Matthieu Darbois
Rex Dieter
Herve Drolon
Antonin Descampe
Francois-Olivier Devaux
Parvatha Elangovan
Jerôme Fimes
Bob Friesenhahn
Kaori Hagihara
Luc Hermitte
Luis Ibanez
David Janssens
Hans Johnson
Callum Lerwick
Sebastien Lugan
Benoit Macq
Mathieu Malaterre
Julien Malik
Arnaud Maye
Vincent Nicolas
Glenn Pearson
Even Rouault
Dzonatas Sol
Winfried Szukalski
Vincent Torri
Yannick Verschueren
Peter Wimmer
* Giuseppe Baruffa
* Ben Boeckel
* Aaron Boxer
* David Burken
* Matthieu Darbois
* Rex Dieter
* Herve Drolon
* Antonin Descampe
* Francois-Olivier Devaux
* Parvatha Elangovan
* Jerôme Fimes
* Bob Friesenhahn
* Kaori Hagihara
* Luc Hermitte
* Luis Ibanez
* David Janssens
* Hans Johnson
* Callum Lerwick
* Ke Liu (Tencent's Xuanwu LAB)
* Sebastien Lugan
* Benoit Macq
* Mathieu Malaterre
* Julien Malik
* Arnaud Maye
* Vincent Nicolas
* Glenn Pearson
* Even Rouault
* Dzonatas Sol
* Winfried Szukalski
* Vincent Torri
* Yannick Verschueren
* Peter Wimmer

View File

@ -32,7 +32,7 @@
.TH opj_compress 1 "Version 2.1.1" "opj_compress" "converts to jpeg2000 files"
.P
.SH NAME
opj_compress -
opj_compress \-
This program reads in an image of a certain type and converts it to a
jpeg2000 file. It is part of the OpenJPEG library.
.SP
@ -43,20 +43,20 @@ Valid output image extensions are
.B .j2k, .jp2
.SH SYNOPSIS
.P
.B opj_compress -i \fRinfile.bmp \fB-o \fRoutfile.j2k
.B opj_compress \-i \fRinfile.bmp \fB-o \fRoutfile.j2k
.P
.B opj_compress -ImgDir \fRdirectory_name \fB-OutFor \fRjp2
.B opj_compress \-ImgDir \fRdirectory_name \fB-OutFor \fRjp2
.P
.B opj_compress -h \fRPrint a help message and exit.
.B opj_compress \-h \fRPrint a help message and exit.
.P
.R See JPWL OPTIONS for special options
.SH OPTIONS
.TP
.B \-\^b " n,n"
(Size of code block (e.g. -b 32,32). Default: 64 x 64)
(Size of code block (e.g. \-b 32,32). Default: 64 x 64)
.TP
.B \-\^c " n"
(Size of precinct (e.g. -c 128,128). Default: 2^15 x 2^15)
(Size of precinct (e.g. \-c 128,128). Default: 2^15 x 2^15)
.TP
.B \-\^cinema2K " fps"
Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or 48.
@ -65,7 +65,7 @@ Digital Cinema 2K profile compliant codestream. Valid \fBfps\fR values are 24 or
Digital Cinema 4K profile compliant codestream. Does not need an fps: default is 24 fps.
.TP
.B \-\^d " X,Y"
(Offset of image origin (e.g. -d 150,300))
(Offset of image origin (e.g. \-d 150,300))
.TP
.B \-\^h
Print a help message and exit.
@ -85,20 +85,20 @@ Progression order. \fBname\fR can be one out of:LRCP, RLCP, RPCL, PCRL, CPRL. De
.B \-\^q " n"
different psnr for successive layers
.br
.B Note: \fR(options -r and -q cannot be used together)
.B Note: \fR(options \-r and \-q cannot be used together)
.TP
.B \-\^r " n"
different compression ratio(s) for successive layers. The rate specified for each quality level is the desired compression factor.
.br
.B Note: \fR(options -r and -q cannot be used together)
.B Note: \fR(options \-r and \-q cannot be used together)
.TP
.B \-\^s " X,Y"
sub-sampling factor (e.g. -s 2,2). Default: No sub-sampling in x or y direction.
sub-sampling factor (e.g. \-s 2,2). Default: No sub-sampling in x or y direction.
.br
.B Remark: \fRsub-sampling bigger than 2 can produce errors.
.TP
.B \-\^t " W,H"
(Size of tile (e.g. -t 512,512) )
(Size of tile (e.g. \-t 512,512) )
.TP
.B \-\^x " name"
(Create index file and fill it. Default: no index file)
@ -132,7 +132,7 @@ ERTERM(16)
.br
SEGMARK(32)
.br
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = \-M 38
.TP
.B \-\^OutFor "ext"
(extension for output files)
@ -149,7 +149,7 @@ e.g. \fB-ROI c=0,U=25\fR
(Write SOP marker before each packet. Default: No SOP marker in the codestream.)
.TP
.B \-\^T "X,Y"
(Offset of the origin of the tiles (e.g. -T 100,75) )
(Offset of the origin of the tiles (e.g. \-T 100,75) )
.TP
.B \-\^W
(see JPWL OPTIONS)
@ -157,7 +157,7 @@ e.g. \fB-ROI c=0,U=25\fR
.SH JPWL OPTIONS
Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
.P
.B -W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>
.B \-W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>
.P
.B h\fR selects the header error protection (EPB): \fBtype\fR can be
[0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]
@ -176,7 +176,7 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
(max. 16 specs)
.P
.B s \fRenables sensitivity data insertion (ESD): \fBmethod\fR can be
[-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
[\-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]
if \fBtilepart\fR is absent, it is for main header only
if \fBtilepart\fR is present, it applies from that tile
@ -194,13 +194,13 @@ Options usable only if the library has been compiled with \fB-DUSE_JPWL\fR
.P
.SH EXAMPLES
.P
.B opj_compress -i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless).
.B opj_compress \-i \fRfile.bmp \fB-o \fRfile.j2k \fB-r \fR20,10,1 (compress 20x, then 10x, then lossless).
.P
.B opj_compress -i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50
.B opj_compress \-i \fRfile.ppm \fB-o \fRfile.j2k \fB-q \fR30,40,50
.P
.B opj_compress -i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL
.B opj_compress \-i \fRfile.pgx \fB-o \fRfile.j2k \fB-POC \fRT1=0,0,1,5,3,CPRL
.P
.B opj_compress -i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
.B opj_compress \-i \fRlena.raw \fB-o \fRlena.j2k \fB-F \fR512,512,3,8,u
.P
.SH AUTHORS
Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium

View File

@ -32,7 +32,7 @@
.TH opj_decompress 1 "Version 2.1.1" "opj_decompress" "converts jpeg2000 files"
.P
.SH NAME
opj_decompress -
opj_decompress \-
This program reads in a jpeg2000 image and converts it to another
image type. It is part of the OpenJPEG library.
.SP
@ -43,11 +43,11 @@ Valid output image extensions are
.B .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif \fR. For PNG resp. TIF it needs libpng resp. libtiff .
.SH SYNOPSIS
.P
.B opj_decompress -i \fRinfile.j2k \fB-o \fRoutfile.png
.B opj_decompress \-i \fRinfile.j2k \fB-o \fRoutfile.png
.P
.B opj_decompress -ImgDir \fRimages/ \fB-OutFor \fRbmp
.B opj_decompress \-ImgDir \fRimages/ \fB-OutFor \fRbmp
.P
.B opj_decompress -h \fRPrint help message and exit
.B opj_decompress \-h \fRPrint help message and exit
.P
.R See JPWL OPTIONS for special options
.SH OPTIONS

View File

@ -32,7 +32,7 @@
.TH opj_dump 1 "Version 2.1.1" "opj_dump" "dumps jpeg2000 files"
.P
.SH NAME
opj_dump -
opj_dump \-
This program reads in a jpeg2000 image and dumps the contents to stdout. It is part of the OpenJPEG library.
.SP
Valid input image extensions are
@ -40,11 +40,11 @@ Valid input image extensions are
.SP
.SH SYNOPSIS
.P
.B opj_dump -i \fRinfile.j2k
.B opj_dump \-i \fRinfile.j2k
.P
.B opj_dump -ImgDir \fRimages/ \fRDump all files in images/
.B opj_dump \-ImgDir \fRimages/ \fRDump all files in images/
.P
.B opj_dump -h \fRPrint help message and exit
.B opj_dump \-h \fRPrint help message and exit
.P
.SH OPTIONS
.TP

View File

@ -1328,11 +1328,14 @@ struct pnm_header
static char *skip_white(char *s)
{
while(*s)
if (s != NULL)
{
if(*s == '\n' || *s == '\r') return NULL;
if(isspace(*s)) { ++s; continue; }
return s;
while(*s)
{
if(*s == '\n' || *s == '\r') return NULL;
if(isspace(*s)) { ++s; continue; }
return s;
}
}
return NULL;
}
@ -1377,7 +1380,7 @@ static char *skip_idf(char *start, char out_idf[256])
static void read_pnm_header(FILE *reader, struct pnm_header *ph)
{
int format, have_wh, end, ttype;
int format, end, ttype;
char idf[256], type[256];
char line[256];
@ -1398,11 +1401,12 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
return;
}
ph->format = format;
ttype = end = have_wh = 0;
ttype = end = 0;
while(fgets(line, 250, reader))
{
char *s;
int allow_null = 0;
if(*line == '#') continue;
@ -1478,36 +1482,25 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
return;
} /* if(format == 7) */
if( !have_wh)
{
/* Here format is in range [1,6] */
if (ph->width == 0) {
s = skip_int(s, &ph->width);
if ((s == NULL) || (*s == 0) || (ph->width < 1)) return;
allow_null = 1;
}
if (ph->height == 0) {
s = skip_int(s, &ph->height);
have_wh = 1;
if(format == 1 || format == 4) break;
if(format == 2 || format == 3 || format == 5 || format == 6)
{
if (skip_int(s, &ph->maxval) != NULL) {
if(ph->maxval > 65535) {
return;
}
else {
break;
}
}
if ((s == NULL) && allow_null) continue;
if ((s == NULL) || (*s == 0) || (ph->height < 1)) return;
if(format == 1 || format == 4) {
break;
}
continue;
}
if(format == 2 || format == 3 || format == 5 || format == 6)
{
/* P2, P3, P5, P6: */
s = skip_int(s, &ph->maxval);
if(ph->maxval > 65535) return;
allow_null = 1;
}
/* here, format is in P2, P3, P5, P6 */
s = skip_int(s, &ph->maxval);
if ((s == NULL) && allow_null) continue;
if ((s == NULL) || (*s == 0)) return;
break;
}/* while(fgets( ) */
if(format == 2 || format == 3 || format > 4)
@ -1524,18 +1517,14 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
}
if(ph->depth < 1 || ph->depth > 4) return;
if(ph->width && ph->height && ph->depth && ph->maxval && ttype)
if (ttype)
ph->ok = 1;
}
else
{
if(format != 1 && format != 4)
ph->ok = 1;
if(format == 1 || format == 4)
{
if(ph->width && ph->height && ph->maxval) ph->ok = 1;
}
else
{
if(ph->width && ph->height) ph->ok = 1;
ph->maxval = 255;
}
}

View File

@ -675,10 +675,28 @@ opj_image_t* bmptoimage(const char *filename, opj_cparameters_t *parameters)
}
}
if (Info_h.biWidth == 0 || Info_h.biHeight == 0) {
fclose(IN);
return NULL;
}
if (Info_h.biBitCount > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
fclose(IN);
return NULL;
}
stride = ((Info_h.biWidth * Info_h.biBitCount + 31U) / 32U) * 4U; /* rows are aligned on 32bits */
if (Info_h.biBitCount == 4 && Info_h.biCompression == 2) { /* RLE 4 gets decoded as 8 bits data for now... */
if (8 > (((OPJ_UINT32)-1) - 31) / Info_h.biWidth) {
fclose(IN);
return NULL;
}
stride = ((Info_h.biWidth * 8U + 31U) / 32U) * 4U;
}
if (stride > ((OPJ_UINT32)-1) / sizeof(OPJ_UINT8) / Info_h.biHeight) {
fclose(IN);
return NULL;
}
pData = (OPJ_UINT8 *) calloc(1, stride * Info_h.biHeight * sizeof(OPJ_UINT8));
if (pData == NULL) {
fclose(IN);

View File

@ -236,7 +236,7 @@ static void encode_help_display(void) {
fprintf(stdout,"-I\n");
fprintf(stdout," Use the irreversible DWT 9-7.\n");
fprintf(stdout,"-mct <0|1|2>\n");
fprintf(stdout," Explicitely specifies if a Multiple Component Transform has to be used.\n");
fprintf(stdout," Explicitly specifies if a Multiple Component Transform has to be used.\n");
fprintf(stdout," 0: no MCT ; 1: RGB->YCC conversion ; 2: custom MCT.\n");
fprintf(stdout," If custom MCT, \"-m\" option has to be used (see hereunder).\n");
fprintf(stdout," By default, RGB->YCC conversion is used if there are 3 components or more,\n");
@ -1029,7 +1029,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
return 1;
}
fprintf(stdout,"CINEMA 2K profile activated\n"
"Other options specified could be overriden\n");
"Other options specified could be overridden\n");
}
break;
@ -1040,7 +1040,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
{
parameters->rsiz = OPJ_PROFILE_CINEMA_4K;
fprintf(stdout,"CINEMA 4K profile activated\n"
"Other options specified could be overriden\n");
"Other options specified could be overridden\n");
}
break;

View File

@ -187,10 +187,9 @@ static int tga_readheader(FILE *fp, unsigned int *bits_per_pixel,
#ifdef OPJ_BIG_ENDIAN
static inline int16_t swap16(int16_t x)
static inline uint16_t swap16(uint16_t x)
{
return((((u_int16_t)x & 0x00ffU) << 8) |
(((u_int16_t)x & 0xff00U) >> 8));
return(((x & 0x00ffU) << 8) | ((x & 0xff00U) >> 8));
}
#endif

View File

@ -5,7 +5,7 @@ install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)
include_directories(
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h
)
# Defines the source code for the library
set(OPENJPEG_SRCS
@ -110,11 +110,13 @@ install(
DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
endif()
# internal utilities to generate t1_luts.h (part of the jp2 lib)
if(BUILD_LUTS_GENERATOR)
# internal utility to generate t1_luts.h (part of the jp2 lib)
# no need to install:
add_executable(t1_generate_luts t1_generate_luts.c)
if(UNIX)
target_link_libraries(t1_generate_luts m)
add_executable(t1_generate_luts t1_generate_luts.c)
if(UNIX)
target_link_libraries(t1_generate_luts m)
endif()
endif()
# Experimental option; let's how cppcheck performs

View File

@ -129,16 +129,16 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 i, DWT
static OPJ_BOOL opj_dwt_encode_procedure( opj_tcd_tilecomp_t * tilec,
void (*p_function)(OPJ_INT32 *, OPJ_INT32,OPJ_INT32,OPJ_INT32) );
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i);
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* OPJ_RESTRICT r, OPJ_UINT32 i);
/* <summary> */
/* Inverse 9-7 wavelet transform in 1-D. */
/* </summary> */
static void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt);
static void opj_v4dwt_decode(opj_v4dwt_t* OPJ_RESTRICT dwt);
static void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size);
static void opj_v4dwt_interleave_h(opj_v4dwt_t* OPJ_RESTRICT w, OPJ_FLOAT32* OPJ_RESTRICT a, OPJ_INT32 x, OPJ_INT32 size);
static void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read);
static void opj_v4dwt_interleave_v(opj_v4dwt_t* OPJ_RESTRICT v , OPJ_FLOAT32* OPJ_RESTRICT a , OPJ_INT32 x, OPJ_INT32 nb_elts_read);
#ifdef __SSE__
static void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c);
@ -395,7 +395,7 @@ static INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void
OPJ_INT32 rw; /* width of the resolution level computed */
OPJ_INT32 rh; /* height of the resolution level computed */
OPJ_UINT32 l_data_size;
size_t l_data_size;
opj_tcd_resolution_t * l_cur_res = 0;
opj_tcd_resolution_t * l_last_res = 0;
@ -407,11 +407,20 @@ static INLINE OPJ_BOOL opj_dwt_encode_procedure(opj_tcd_tilecomp_t * tilec,void
l_cur_res = tilec->resolutions + l;
l_last_res = l_cur_res - 1;
l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
bj = (OPJ_INT32*)opj_malloc((size_t)l_data_size);
l_data_size = opj_dwt_max_resolution(tilec->resolutions, tilec->numresolutions);
/* overflow check */
if (l_data_size > (SIZE_MAX / sizeof(OPJ_INT32))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
l_data_size *= sizeof(OPJ_INT32);
bj = (OPJ_INT32*)opj_malloc(l_data_size);
/* l_data_size is equal to 0 when numresolutions == 1 but bj is not used */
/* in that case, so do not error out */
if (l_data_size != 0 && ! bj) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
i = l;
@ -543,7 +552,7 @@ void opj_dwt_calc_explicit_stepsizes(opj_tccp_t * tccp, OPJ_UINT32 prec) {
/* <summary> */
/* Determine maximum computed resolution level for inverse wavelet transform */
/* </summary> */
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* restrict r, OPJ_UINT32 i) {
static OPJ_UINT32 opj_dwt_max_resolution(opj_tcd_resolution_t* OPJ_RESTRICT r, OPJ_UINT32 i) {
OPJ_UINT32 mr = 0;
OPJ_UINT32 w;
while( --i ) {
@ -569,11 +578,23 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres
OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0); /* height of the resolution level computed */
OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);
size_t mr; /* max resolution */
if (numres == 1U) {
return OPJ_TRUE;
}
h.mem = (OPJ_INT32*)opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32));
mr = opj_dwt_max_resolution(tr, numres);
/* overflow check */
if (mr > (SIZE_MAX / sizeof(OPJ_INT32))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
mr *= sizeof(OPJ_INT32);
h.mem = (OPJ_INT32*)opj_aligned_malloc(mr);
if (! h.mem){
/* FIXME event manager error callback */
return OPJ_FALSE;
@ -582,7 +603,7 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres
v.mem = h.mem;
while( --numres) {
OPJ_INT32 * restrict tiledp = tilec->data;
OPJ_INT32 * OPJ_RESTRICT tiledp = tilec->data;
OPJ_UINT32 j;
++tr;
@ -617,8 +638,8 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres
return OPJ_TRUE;
}
static void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restrict a, OPJ_INT32 x, OPJ_INT32 size){
OPJ_FLOAT32* restrict bi = (OPJ_FLOAT32*) (w->wavelet + w->cas);
static void opj_v4dwt_interleave_h(opj_v4dwt_t* OPJ_RESTRICT w, OPJ_FLOAT32* OPJ_RESTRICT a, OPJ_INT32 x, OPJ_INT32 size){
OPJ_FLOAT32* OPJ_RESTRICT bi = (OPJ_FLOAT32*) (w->wavelet + w->cas);
OPJ_INT32 count = w->sn;
OPJ_INT32 i, k;
@ -660,8 +681,8 @@ static void opj_v4dwt_interleave_h(opj_v4dwt_t* restrict w, OPJ_FLOAT32* restric
}
}
static void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restrict a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){
opj_v4_t* restrict bi = v->wavelet + v->cas;
static void opj_v4dwt_interleave_v(opj_v4dwt_t* OPJ_RESTRICT v , OPJ_FLOAT32* OPJ_RESTRICT a , OPJ_INT32 x, OPJ_INT32 nb_elts_read){
opj_v4_t* OPJ_RESTRICT bi = v->wavelet + v->cas;
OPJ_INT32 i;
for(i = 0; i < v->sn; ++i){
@ -679,7 +700,7 @@ static void opj_v4dwt_interleave_v(opj_v4dwt_t* restrict v , OPJ_FLOAT32* restri
#ifdef __SSE__
static void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m128 c){
__m128* restrict vw = (__m128*) w;
__m128* OPJ_RESTRICT vw = (__m128*) w;
OPJ_INT32 i;
/* 4x unrolled loop */
for(i = 0; i < count >> 2; ++i){
@ -700,8 +721,8 @@ static void opj_v4dwt_decode_step1_sse(opj_v4_t* w, OPJ_INT32 count, const __m12
}
void opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32 m, __m128 c){
__m128* restrict vl = (__m128*) l;
__m128* restrict vw = (__m128*) w;
__m128* OPJ_RESTRICT vl = (__m128*) l;
__m128* OPJ_RESTRICT vw = (__m128*) w;
OPJ_INT32 i;
__m128 tmp1, tmp2, tmp3;
tmp1 = vl[0];
@ -729,7 +750,7 @@ void opj_v4dwt_decode_step2_sse(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_INT32
static void opj_v4dwt_decode_step1(opj_v4_t* w, OPJ_INT32 count, const OPJ_FLOAT32 c)
{
OPJ_FLOAT32* restrict fw = (OPJ_FLOAT32*) w;
OPJ_FLOAT32* OPJ_RESTRICT fw = (OPJ_FLOAT32*) w;
OPJ_INT32 i;
for(i = 0; i < count; ++i){
OPJ_FLOAT32 tmp1 = fw[i*8 ];
@ -797,7 +818,7 @@ static void opj_v4dwt_decode_step2(opj_v4_t* l, opj_v4_t* w, OPJ_INT32 k, OPJ_IN
/* <summary> */
/* Inverse 9-7 wavelet transform in 1-D. */
/* </summary> */
static void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt)
static void opj_v4dwt_decode(opj_v4dwt_t* OPJ_RESTRICT dwt)
{
OPJ_INT32 a, b;
if(dwt->cas == 0) {
@ -834,7 +855,7 @@ static void opj_v4dwt_decode(opj_v4dwt_t* restrict dwt)
/* <summary> */
/* Inverse 9-7 wavelet transform in 2-D. */
/* </summary> */
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres)
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres)
{
opj_v4dwt_t h;
opj_v4dwt_t v;
@ -845,8 +866,25 @@ OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numr
OPJ_UINT32 rh = (OPJ_UINT32)(res->y1 - res->y0); /* height of the resolution level computed */
OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);
size_t mr; /* max resolution */
mr = opj_dwt_max_resolution(res, numres);
/* overflow check */
if (mr > (0xFFFFFFFFU /* UINT32_MAX */ - 5U)) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
mr += 5U;
if (mr > (SIZE_MAX / sizeof(opj_v4_t))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res, numres)+5) * sizeof(opj_v4_t));
mr *= sizeof(opj_v4_t);
h.wavelet = (opj_v4_t*) opj_aligned_malloc(mr);
if (!h.wavelet) {
/* FIXME event manager error callback */
return OPJ_FALSE;
@ -854,7 +892,7 @@ OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numr
v.wavelet = h.wavelet;
while( --numres) {
OPJ_FLOAT32 * restrict aj = (OPJ_FLOAT32*) tilec->data;
OPJ_FLOAT32 * OPJ_RESTRICT aj = (OPJ_FLOAT32*) tilec->data;
OPJ_UINT32 bufsize = (OPJ_UINT32)((tilec->x1 - tilec->x0) * (tilec->y1 - tilec->y0));
OPJ_INT32 j;

View File

@ -93,7 +93,7 @@ Apply an irreversible inverse DWT transform to a component of an image.
@param tilec Tile component information (current tile)
@param numres Number of resolution levels to decode
*/
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numres);
OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec, OPJ_UINT32 numres);
/**
Get the gain of a subband for the irreversible 9-7 DWT.

View File

@ -5405,6 +5405,7 @@ static OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
OPJ_UINT32 l_nb_collections;
OPJ_UINT32 l_nb_comps;
OPJ_UINT32 l_nb_bytes_by_comp;
OPJ_BOOL l_new_mcc = OPJ_FALSE;
/* preconditions */
assert(p_header_data != 00);
@ -5466,6 +5467,7 @@ static OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
memset(l_mcc_record,0,(l_tcp->m_nb_max_mcc_records-l_tcp->m_nb_mcc_records) * sizeof(opj_simple_mcc_decorrelation_data_t));
}
l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;
l_new_mcc = OPJ_TRUE;
}
l_mcc_record->m_index = l_indix;
@ -5601,7 +5603,9 @@ static OPJ_BOOL opj_j2k_read_mcc ( opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
++l_tcp->m_nb_mcc_records;
if (l_new_mcc) {
++l_tcp->m_nb_mcc_records;
}
return OPJ_TRUE;
}
@ -8217,8 +8221,14 @@ static OPJ_BOOL opj_j2k_update_image_data (opj_tcd_t * p_tcd, OPJ_BYTE * p_data,
/* Allocate output component buffer if necessary */
if (!l_img_comp_dest->data) {
OPJ_SIZE_T l_width = l_img_comp_dest->w;
OPJ_SIZE_T l_height = l_img_comp_dest->h;
l_img_comp_dest->data = (OPJ_INT32*) opj_calloc((OPJ_SIZE_T)l_img_comp_dest->w * (OPJ_SIZE_T)l_img_comp_dest->h, sizeof(OPJ_INT32));
if ((l_height == 0U) || (l_width > (SIZE_MAX / l_height))) {
/* would overflow */
return OPJ_FALSE;
}
l_img_comp_dest->data = (OPJ_INT32*) opj_calloc(l_width * l_height, sizeof(OPJ_INT32));
if (! l_img_comp_dest->data) {
return OPJ_FALSE;
}

View File

@ -552,6 +552,11 @@ static OPJ_BOOL opj_jp2_read_ihdr( opj_jp2_t *jp2,
assert(jp2 != 00);
assert(p_manager != 00);
if (jp2->comps != NULL) {
opj_event_msg(p_manager, EVT_WARNING, "Ignoring ihdr box. First ihdr box already read\n");
return OPJ_TRUE;
}
if (p_image_header_size != 14) {
opj_event_msg(p_manager, EVT_ERROR, "Bad image header box (bad size)\n");
return OPJ_FALSE;
@ -563,6 +568,11 @@ static OPJ_BOOL opj_jp2_read_ihdr( opj_jp2_t *jp2,
p_image_header_data += 4;
opj_read_bytes(p_image_header_data,&(jp2->numcomps),2); /* NC */
p_image_header_data += 2;
if ((jp2->numcomps - 1U) >= 16384U) { /* unsigned underflow is well defined: 1U <= jp2->numcomps <= 16384U */
opj_event_msg(p_manager, EVT_ERROR, "Invalid number of components (ihdr)\n");
return OPJ_FALSE;
}
/* allocate memory for components */
jp2->comps = (opj_jp2_comps_t*) opj_calloc(jp2->numcomps, sizeof(opj_jp2_comps_t));
@ -1764,7 +1774,7 @@ void opj_jp2_setup_decoder(opj_jp2_t *jp2, opj_dparameters_t *parameters)
/* further JP2 initializations go here */
jp2->color.jp2_has_colr = 0;
jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
jp2->ignore_pclr_cmap_cdef = parameters->flags & OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
}
/* ----------------------------------------------------------------------- */
@ -1810,7 +1820,6 @@ OPJ_BOOL opj_jp2_setup_encoder( opj_jp2_t *jp2,
jp2->numcl = 1;
jp2->cl = (OPJ_UINT32*) opj_malloc(jp2->numcl * sizeof(OPJ_UINT32));
if (!jp2->cl){
jp2->cl = NULL;
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory when setup the JP2 encoder\n");
return OPJ_FALSE;
}
@ -1821,7 +1830,6 @@ OPJ_BOOL opj_jp2_setup_encoder( opj_jp2_t *jp2,
jp2->numcomps = image->numcomps; /* NC */
jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t));
if (!jp2->comps) {
jp2->comps = NULL;
opj_event_msg(p_manager, EVT_ERROR, "Not enough memory when setup the JP2 encoder\n");
/* Memory of jp2->cl will be freed by opj_jp2_destroy */
return OPJ_FALSE;

View File

@ -74,9 +74,9 @@ const OPJ_FLOAT64 * opj_mct_get_mct_norms_real ()
/* </summary> */
#ifdef __SSE2__
void opj_mct_encode(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_SIZE_T i;
@ -116,9 +116,9 @@ void opj_mct_encode(
}
#else
void opj_mct_encode(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_SIZE_T i;
@ -143,9 +143,9 @@ void opj_mct_encode(
/* </summary> */
#ifdef __SSE2__
void opj_mct_decode(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_SIZE_T i;
@ -178,9 +178,9 @@ void opj_mct_decode(
}
#else
void opj_mct_decode(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_UINT32 i;
@ -210,9 +210,9 @@ OPJ_FLOAT64 opj_mct_getnorm(OPJ_UINT32 compno) {
/* </summary> */
#ifdef __SSE4_1__
void opj_mct_encode_real(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_SIZE_T i;
@ -351,9 +351,9 @@ void opj_mct_encode_real(
}
#else
void opj_mct_encode_real(
OPJ_INT32* restrict c0,
OPJ_INT32* restrict c1,
OPJ_INT32* restrict c2,
OPJ_INT32* OPJ_RESTRICT c0,
OPJ_INT32* OPJ_RESTRICT c1,
OPJ_INT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_UINT32 i;
@ -375,9 +375,9 @@ void opj_mct_encode_real(
/* Inverse irreversible MCT. */
/* </summary> */
void opj_mct_decode_real(
OPJ_FLOAT32* restrict c0,
OPJ_FLOAT32* restrict c1,
OPJ_FLOAT32* restrict c2,
OPJ_FLOAT32* OPJ_RESTRICT c0,
OPJ_FLOAT32* OPJ_RESTRICT c1,
OPJ_FLOAT32* OPJ_RESTRICT c2,
OPJ_UINT32 n)
{
OPJ_UINT32 i;

View File

@ -60,7 +60,7 @@ Apply a reversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
void opj_mct_encode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply a reversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -68,7 +68,7 @@ Apply a reversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
void opj_mct_decode(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the reversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)
@ -83,7 +83,7 @@ Apply an irreversible multi-component transform to an image
@param c2 Samples blue component
@param n Number of samples for each component
*/
void opj_mct_encode_real(OPJ_INT32 *c0, OPJ_INT32 *c1, OPJ_INT32 *c2, OPJ_UINT32 n);
void opj_mct_encode_real(OPJ_INT32* OPJ_RESTRICT c0, OPJ_INT32* OPJ_RESTRICT c1, OPJ_INT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Apply an irreversible multi-component inverse transform to an image
@param c0 Samples for luminance component
@ -91,7 +91,7 @@ Apply an irreversible multi-component inverse transform to an image
@param c2 Samples for blue chrominance component
@param n Number of samples for each component
*/
void opj_mct_decode_real(OPJ_FLOAT32* c0, OPJ_FLOAT32* c1, OPJ_FLOAT32* c2, OPJ_UINT32 n);
void opj_mct_decode_real(OPJ_FLOAT32* OPJ_RESTRICT c0, OPJ_FLOAT32* OPJ_RESTRICT c1, OPJ_FLOAT32* OPJ_RESTRICT c2, OPJ_UINT32 n);
/**
Get norm of the basis function used for the irreversible multi-component transform
@param compno Number of the component (0->Y, 1->U, 2->V)

View File

@ -103,12 +103,21 @@
*/
/* Are restricted pointers available? (C99) */
#if (__STDC_VERSION__ != 199901L)
#if (__STDC_VERSION__ >= 199901L)
#define OPJ_RESTRICT restrict
#else
/* Not a C99 compiler */
#ifdef __GNUC__
#define restrict __restrict__
#if defined(__GNUC__)
#define OPJ_RESTRICT __restrict__
/*
vc14 (2015) outputs wrong results.
Need to check OPJ_RESTRICT usage (or a bug in vc14)
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#define OPJ_RESTRICT __restrict
*/
#else
#define restrict /* restrict */
#define OPJ_RESTRICT /* restrict */
#endif
#endif

View File

@ -1237,9 +1237,15 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
l_current_pi = l_pi;
/* memory allocation for include */
l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
if
(!l_current_pi->include)
/* prevent an integer overflow issue */
/* 0 < l_tcp->numlayers < 65536 c.f. opj_j2k_read_cod in j2k.c */
l_current_pi->include = 00;
if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U)))
{
l_current_pi->include = (OPJ_INT16*) opj_calloc((size_t)(l_tcp->numlayers + 1U) * l_step_l, sizeof(OPJ_INT16));
}
if (!l_current_pi->include)
{
opj_free(l_tmp_data);
opj_free(l_tmp_ptr);

View File

@ -1166,41 +1166,71 @@ static OPJ_BOOL opj_t1_allocate_buffers(
OPJ_UINT32 w,
OPJ_UINT32 h)
{
OPJ_UINT32 datasize=w * h;
OPJ_UINT32 flagssize;
size_t flagssize;
/* encoder uses tile buffer, so no need to allocate */
if (!t1->encoder) {
if(datasize > t1->datasize){
size_t datasize;
/* Overflow check */
if ((w > 0U) && (h > (0xFFFFFFFFU /* UINT32_MAX */ / w))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
datasize = (size_t) w * h;
/* Overflow check */
if (datasize > (SIZE_MAX / sizeof(OPJ_INT32))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
if(datasize > (size_t) t1->datasize){
opj_aligned_free(t1->data);
t1->data = (OPJ_INT32*) opj_aligned_malloc(datasize * sizeof(OPJ_INT32));
t1->data = (OPJ_INT32*) opj_aligned_malloc(datasize * sizeof(OPJ_INT32));
if(!t1->data){
/* FIXME event manager error callback */
return OPJ_FALSE;
}
t1->datasize=datasize;
t1->datasize = (OPJ_UINT32) datasize;
}
/* memset first arg is declared to never be null by gcc */
if (t1->data != NULL) {
memset(t1->data,0,datasize * sizeof(OPJ_INT32));
memset(t1->data, 0, datasize * sizeof(OPJ_INT32));
}
}
t1->flags_stride=w+2;
flagssize=t1->flags_stride * (h+2);
if ((w > (0xFFFFFFFFU /* UINT32_MAX */ - 2U)) || (h > (0xFFFFFFFFU /* UINT32_MAX */ - 2U))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
t1->flags_stride = w + 2U; /* can't be 0U */
if ((h + 2U) > (0xFFFFFFFFU /* UINT32_MAX */ / t1->flags_stride)) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
flagssize = (size_t) t1->flags_stride * (h + 2U);
if(flagssize > t1->flagssize){
/* Overflow check */
if (flagssize > (SIZE_MAX / sizeof(opj_flag_t))) {
/* FIXME event manager error callback */
return OPJ_FALSE;
}
if(flagssize > (size_t) t1->flagssize){
opj_aligned_free(t1->flags);
t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(opj_flag_t));
t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(opj_flag_t));
if(!t1->flags){
/* FIXME event manager error callback */
return OPJ_FALSE;
}
t1->flagssize=flagssize;
t1->flagssize = (OPJ_UINT32) flagssize;
}
memset(t1->flags,0,flagssize * sizeof(opj_flag_t));
memset(t1->flags, 0, flagssize * sizeof(opj_flag_t));
t1->w=w;
t1->h=h;
t1->w = w;
t1->h = h;
return OPJ_TRUE;
}
@ -1283,14 +1313,14 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1,
opj_tcd_resolution_t* res = &tilec->resolutions[resno];
for (bandno = 0; bandno < res->numbands; ++bandno) {
opj_tcd_band_t* restrict band = &res->bands[bandno];
opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno];
for (precno = 0; precno < res->pw * res->ph; ++precno) {
opj_tcd_precinct_t* precinct = &band->precincts[precno];
for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {
opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];
OPJ_INT32* restrict datap;
OPJ_INT32* OPJ_RESTRICT datap;
OPJ_UINT32 cblk_w, cblk_h;
OPJ_INT32 x, y;
OPJ_UINT32 i, j;
@ -1333,7 +1363,7 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1,
}
}
if (tccp->qmfbid == 1) {
OPJ_INT32* restrict tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];
OPJ_INT32* OPJ_RESTRICT tiledp = &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];
for (j = 0; j < cblk_h; ++j) {
for (i = 0; i < cblk_w; ++i) {
OPJ_INT32 tmp = datap[(j * cblk_w) + i];
@ -1341,9 +1371,9 @@ OPJ_BOOL opj_t1_decode_cblks( opj_t1_t* t1,
}
}
} else { /* if (tccp->qmfbid == 0) */
OPJ_FLOAT32* restrict tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];
OPJ_FLOAT32* OPJ_RESTRICT tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_UINT32)y * tile_w + (OPJ_UINT32)x];
for (j = 0; j < cblk_h; ++j) {
OPJ_FLOAT32* restrict tiledp2 = tiledp;
OPJ_FLOAT32* OPJ_RESTRICT tiledp2 = tiledp;
for (i = 0; i < cblk_w; ++i) {
OPJ_FLOAT32 tmp = (OPJ_FLOAT32)*datap * band->stepsize;
*tiledp2 = tmp;
@ -1475,7 +1505,7 @@ OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1,
opj_tcd_resolution_t *res = &tilec->resolutions[resno];
for (bandno = 0; bandno < res->numbands; ++bandno) {
opj_tcd_band_t* restrict band = &res->bands[bandno];
opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno];
OPJ_INT32 bandconst = 8192 * 8192 / ((OPJ_INT32) floor(band->stepsize * 8192));
for (precno = 0; precno < res->pw * res->ph; ++precno) {
@ -1483,7 +1513,7 @@ OPJ_BOOL opj_t1_encode_cblks( opj_t1_t *t1,
for (cblkno = 0; cblkno < prc->cw * prc->ch; ++cblkno) {
opj_tcd_cblk_enc_t* cblk = &prc->cblks.enc[cblkno];
OPJ_INT32* restrict tiledp;
OPJ_INT32* OPJ_RESTRICT tiledp;
OPJ_UINT32 cblk_w;
OPJ_UINT32 cblk_h;
OPJ_UINT32 i, j, tileIndex=0, tileLineAdvance;

View File

@ -52,6 +52,7 @@ static int t1_init_ctxno_zc(int f, int orient) {
t = h;
h = v;
v = t;
/* fall through */
case 0:
case 1:
if (!h) {

View File

@ -696,9 +696,20 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
l_tx0 = l_cp->tx0 + p * l_cp->tdx; /* can't be greater than l_image->x1 so won't overflow */
l_tile->x0 = (OPJ_INT32)opj_uint_max(l_tx0, l_image->x0);
l_tile->x1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_tx0, l_cp->tdx), l_image->x1);
/* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */
if ((l_tile->x0 < 0) || (l_tile->x1 <= l_tile->x0)) {
opj_event_msg(manager, EVT_ERROR, "Tile X coordinates are not supported\n");
return OPJ_FALSE;
}
l_ty0 = l_cp->ty0 + q * l_cp->tdy; /* can't be greater than l_image->y1 so won't overflow */
l_tile->y0 = (OPJ_INT32)opj_uint_max(l_ty0, l_image->y0);
l_tile->y1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_ty0, l_cp->tdy), l_image->y1);
/* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */
if ((l_tile->y0 < 0) || (l_tile->y1 <= l_tile->y0)) {
opj_event_msg(manager, EVT_ERROR, "Tile Y coordinates are not supported\n");
return OPJ_FALSE;
}
/* testcase 1888.pdf.asan.35.988 */
if (l_tccp->numresolutions == 0) {
@ -808,12 +819,22 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
l_br_prc_y_end = opj_int_ceildivpow2(l_res->y1, (OPJ_INT32)l_pdy) << l_pdy;
/*fprintf(stderr, "\t\t\tprc_x_start=%d, prc_y_start=%d, br_prc_x_end=%d, br_prc_y_end=%d \n", l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end ,l_br_prc_y_end );*/
l_res->pw = (l_res->x0 == l_res->x1) ? 0 : (OPJ_UINT32)((l_br_prc_x_end - l_tl_prc_x_start) >> l_pdx);
l_res->ph = (l_res->y0 == l_res->y1) ? 0 : (OPJ_UINT32)((l_br_prc_y_end - l_tl_prc_y_start) >> l_pdy);
l_res->pw = (l_res->x0 == l_res->x1) ? 0U : (OPJ_UINT32)((l_br_prc_x_end - l_tl_prc_x_start) >> l_pdx);
l_res->ph = (l_res->y0 == l_res->y1) ? 0U : (OPJ_UINT32)((l_br_prc_y_end - l_tl_prc_y_start) >> l_pdy);
/*fprintf(stderr, "\t\t\tres_pw=%d, res_ph=%d\n", l_res->pw, l_res->ph );*/
if ((l_res->pw != 0U) && ((((OPJ_UINT32)-1) / l_res->pw) < l_res->ph)) {
opj_event_msg(manager, EVT_ERROR, "Not enough memory for tile data\n");
return OPJ_FALSE;
}
l_nb_precincts = l_res->pw * l_res->ph;
if ((((OPJ_UINT32)-1) / (OPJ_UINT32)sizeof(opj_tcd_precinct_t)) < l_nb_precincts) {
opj_event_msg(manager, EVT_ERROR, "Not enough memory for tile data\n");
return OPJ_FALSE;
}
l_nb_precinct_size = l_nb_precincts * (OPJ_UINT32)sizeof(opj_tcd_precinct_t);
if (resno == 0) {
tlcbgxstart = l_tl_prc_x_start;
tlcbgystart = l_tl_prc_y_start;
@ -870,6 +891,7 @@ static INLINE OPJ_BOOL opj_tcd_init_tile(opj_tcd_t *p_tcd, OPJ_UINT32 p_tile_no,
if (!l_band->precincts && (l_nb_precincts > 0U)) {
l_band->precincts = (opj_tcd_precinct_t *) opj_malloc( /*3 * */ l_nb_precinct_size);
if (! l_band->precincts) {
opj_event_msg(manager, EVT_ERROR, "Not enough memory to handle band precints\n");
return OPJ_FALSE;
}
/*fprintf(stderr, "\t\t\t\tAllocate precincts of a band (opj_tcd_precinct_t): %d\n",l_nb_precinct_size); */

View File

@ -117,6 +117,7 @@ CODmarker_param_t get_CODmkrdata_from_j2kstream( Byte_t *CODstream)
if( *CODstream++ != 0xff || *CODstream++ != 0x52){
fprintf( FCGI_stderr, "Error, COD marker not found in the reconstructed j2kstream\n");
memset(&COD, 0, sizeof(COD));
return COD;
}

View File

@ -438,7 +438,7 @@ void enqueue_allprecincts( int tile_id, int level, int lastcomp, OPJ_BOOL *comps
OPJ_BOOL enqueue_metabins( query_param_t query_param, metadatalist_param_t *metadatalist, msgqueue_param_t *msgqueue)
{
int i;
for( i=0; query_param.box_type[i][0]!=0 && i<MAX_NUMOFBOX; i++){
for( i=0; i<MAX_NUMOFBOX && query_param.box_type[i][0]!=0; i++){
if( query_param.box_type[i][0] == '*'){
fprintf( FCGI_stdout, "Status: 501\r\n");
fprintf( FCGI_stdout, "Reason: metareq with all box-property * not implemented\r\n");

View File

@ -9,7 +9,7 @@ Name: openjpip
Description: JPEG2000 Interactivity tools, APIs and protocols (Part 9)
URL: http://www.openjpeg.org/
Version: @OPENJPEG_VERSION@
Requires: openjp2
Requires: libopenjp2
Libs: -L${libdir} -lopenjpip
Libs.private: -lm -lcurl -lfcgi -lpthread
Cflags: -I${includedir}

View File

@ -264,7 +264,7 @@ void print_queryparam( query_param_t query_param)
}
fprintf( logstream, "\t req-box-prop\n");
for( i=0; query_param.box_type[i][0]!=0 && i<MAX_NUMOFBOX; i++){
for( i=0; i<MAX_NUMOFBOX && query_param.box_type[i][0]!=0; i++){
fprintf( logstream, "\t\t box_type: %.4s limit: %d w:%d s:%d g:%d a:%d priority:%d\n", query_param.box_type[i], query_param.limit[i], query_param.w[i], query_param.s[i], query_param.g[i], query_param.a[i], query_param.priority[i]);
}

View File

@ -9,7 +9,7 @@ Name: openjpwl
Description: JPEG2000 Wireless library (Part 11)
URL: http://www.openjpeg.org/
Version: @OPENJPEG_VERSION@
Requires: openjp2
Requires: libopenjp2
Libs: -L${libdir} -lopenjpwl
Libs.private: -lm
Cflags: -I${includedir}

View File

@ -80,6 +80,8 @@ set_property(TEST rta4 APPEND PROPERTY DEPENDS tte4)
add_test(NAME rta5 COMMAND j2k_random_tile_access tte5.j2k)
set_property(TEST rta5 APPEND PROPERTY DEPENDS tte5)
add_executable(include_openjpeg include_openjpeg.c)
# No image send to the dashboard if lib PNG is not available.
if(NOT OPJ_HAVE_LIBPNG)
message(WARNING "Lib PNG seems to be not available: if you want run the non-regression tests with images reported to the dashboard, you need it (try BUILD_THIRDPARTY)")

View File

@ -118,10 +118,10 @@ int main(int argc, char **argv)
test_cmp_parameters inParam;
FILE *fbase=NULL, *ftest=NULL;
int same = 0;
char lbase[256];
char strbase[256];
char ltest[256];
char strtest[256];
char lbase[512];
char strbase[512];
char ltest[512];
char strtest[512];
if( parse_cmdline_cmp(argc, argv, &inParam) == 1 )
{
@ -154,9 +154,9 @@ int main(int argc, char **argv)
while (fgets(lbase, sizeof(lbase), fbase) && fgets(ltest,sizeof(ltest),ftest))
{
int nbase = sscanf(lbase, "%255[^\r\n]", strbase);
int ntest = sscanf(ltest, "%255[^\r\n]", strtest);
assert( nbase != 255 && ntest != 255 );
int nbase = sscanf(lbase, "%511[^\r\n]", strbase);
int ntest = sscanf(ltest, "%511[^\r\n]", strtest);
assert( nbase != 511 && ntest != 511 );
if( nbase != 1 || ntest != 1 )
{
fprintf(stderr, "could not parse line from files\n" );

9
tests/include_openjpeg.c Normal file
View File

@ -0,0 +1,9 @@
#include <openjpeg.h>
int main(int argc, char **argv)
{
(void)argc;
(void)argv;
return 0;
}

View File

@ -51,6 +51,7 @@ set(BLACKLIST_JPEG2000_TMP
issue427-null-image-size.jp2
issue427-illegal-tile-offset.jp2
issue495.jp2
issue820.jp2
)
# Define a list of file which should be gracefully rejected:

View File

@ -299,3 +299,4 @@ a190e10941e6145e69816c909f832c1a issue559-eci-091-CIELab.jp2_0.pgx
f3081c8e9e9a175f223382a7443b480f issue559-eci-091-CIELab.jp2_2.pgx
3bf91c974abc17e520c6a5efa883a58a issue653-zero-unknownbox.jp2.png
8d7a866d29d5c68dc540b0f0011959a5 issue726.png
3bf91c974abc17e520c6a5efa883a58a issue818.png

View File

@ -146,6 +146,8 @@ opj_compress -i @INPUT_NR_PATH@/flower-minisblack-11.tif -o @TEMP_PATH@/flower-m
opj_compress -i @INPUT_NR_PATH@/flower-minisblack-13.tif -o @TEMP_PATH@/flower-minisblack-13.tif.jp2
opj_compress -i @INPUT_NR_PATH@/flower-minisblack-15.tif -o @TEMP_PATH@/flower-minisblack-15.tif.jp2
# issue 843 Crash with invalid ppm file
!opj_compress -i @INPUT_NR_PATH@/issue843.ppm -o @TEMP_PATH@/issue843.ppm.jp2
# DECODER TEST SUITE
opj_decompress -i @INPUT_NR_PATH@/Bretagne2.j2k -o @TEMP_PATH@/Bretagne2.j2k.pgx
@ -564,3 +566,11 @@ opj_decompress -i @INPUT_NR_PATH@/issue726.j2k -o @TEMP_PATH@/issue726.png
# issue 775
!opj_decompress -i @INPUT_NR_PATH@/issue775.j2k -o @TEMP_PATH@/issue775.png
!opj_decompress -i @INPUT_NR_PATH@/issue775-2.j2k -o @TEMP_PATH@/issue775-2.png
# issue 818
opj_decompress -i @INPUT_NR_PATH@/issue818.jp2 -o @TEMP_PATH@/issue818.png
# issue 823
!opj_decompress -i @INPUT_NR_PATH@/issue823.jp2 -o @TEMP_PATH@/issue823.png
# issue 826
!opj_decompress -i @INPUT_NR_PATH@/issue826.jp2 -o @TEMP_PATH@/issue826.png
# issue 820
!opj_decompress -i @INPUT_NR_PATH@/issue820.jp2 -o @TEMP_PATH@/issue820.png

View File

@ -178,7 +178,7 @@ int main (int argc, char *argv[])
int da_y0=0;
int da_x1=1000;
int da_y1=1000;
char input_file[64];
const char *input_file;
/* should be test_tile_decoder 0 0 1000 1000 tte1.j2k */
if( argc == 6 )
@ -187,7 +187,7 @@ int main (int argc, char *argv[])
da_y0=atoi(argv[2]);
da_x1=atoi(argv[3]);
da_y1=atoi(argv[4]);
strcpy(input_file,argv[5]);
input_file = argv[5];
}
else
@ -196,7 +196,7 @@ int main (int argc, char *argv[])
da_y0=0;
da_x1=1000;
da_y1=1000;
strcpy(input_file,"test.j2k");
input_file = "test.j2k";
}
if (! l_data) {

View File

@ -69,7 +69,7 @@ int main (int argc, char *argv[])
opj_stream_t * l_stream;
OPJ_UINT32 l_nb_tiles;
OPJ_UINT32 l_data_size;
unsigned char len;
size_t len;
#ifdef USING_MCT
const OPJ_FLOAT32 l_mct [] =
@ -96,7 +96,7 @@ int main (int argc, char *argv[])
int tile_height;
int comp_prec;
int irreversible;
char output_file[64];
const char *output_file;
/* should be test_tile_encoder 3 2000 2000 1000 1000 8 tte1.j2k */
if( argc == 9 )
@ -108,7 +108,7 @@ int main (int argc, char *argv[])
tile_height = atoi( argv[5] );
comp_prec = atoi( argv[6] );
irreversible = atoi( argv[7] );
strcpy(output_file, argv[8] );
output_file = argv[8];
}
else
{
@ -119,7 +119,7 @@ int main (int argc, char *argv[])
tile_height = 1000;
comp_prec = 8;
irreversible = 1;
strcpy(output_file, "test.j2k" );
output_file = "test.j2k";
}
if( num_comps > NUM_COMPS_MAX )
{
@ -228,7 +228,7 @@ int main (int argc, char *argv[])
}
/* should we do j2k or jp2 ?*/
len = (unsigned char)strlen( output_file );
len = strlen( output_file );
if( strcmp( output_file + len - 4, ".jp2" ) == 0 )
{
l_codec = opj_create_compress(OPJ_CODEC_JP2);

View File

@ -0,0 +1,453 @@
<!-- kind:binary;verdict:compatible;affected:0;added:0;removed:0;type_problems_high:0;type_problems_medium:0;type_problems_low:0;interface_problems_high:0;interface_problems_medium:0;interface_problems_low:0;changed_constants:0;tool_version:1.99.15 -->
<!-- kind:source;verdict:compatible;affected:0;added:0;removed:0;type_problems_high:0;type_problems_medium:0;type_problems_low:0;interface_problems_high:0;interface_problems_medium:0;interface_problems_low:0;changed_constants:0;tool_version:1.99.15 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="openjpeg, compatibility, API, ABI, report" />
<meta name="description" content="API/ABI compatibility report for the openjpeg object between 2.1 and current versions" />
<title>
openjpeg: 2.1 to current compatibility report
</title>
<style type="text/css">
body {
font-family:Arial, sans-serif;
background-color:White;
color:Black;
}
hr {
color:Black;
background-color:Black;
height:1px;
border:0;
}
h1 {
margin-bottom:0px;
padding-bottom:0px;
font-size:1.625em;
}
h2 {
margin-bottom:0px;
padding-bottom:0px;
font-size:1.25em;
white-space:nowrap;
}
span.section {
font-weight:bold;
cursor:pointer;
color:#003E69;
white-space:nowrap;
margin-left:5px;
}
span.new_sign {
font-weight:bold;
margin-left:26px;
color:#003E69;
}
span.new_sign_lbl {
margin-left:28px;
font-size:0.875em;
color:Black;
}
span:hover.section {
color:#336699;
}
span.section_affected {
cursor:pointer;
margin-left:7px;
padding-left:15px;
font-size:0.875em;
color:#cc3300;
}
span.section_info {
cursor:pointer;
margin-left:7px;
padding-left:15px;
font-size:0.875em;
color:Black;
}
span.extendable {
font-weight:100;
}
span.h_name {
color:#cc3300;
font-size:0.875em;
font-weight:bold;
}
div.h_list, div.lib_list {
font-size:0.94em;
padding-left:5px;
}
span.ns {
color:#408080;
font-size:0.94em;
}
span.lib_name {
color:Green;
font-size:0.875em;
font-weight:bold;
}
span.iname {
font-weight:bold;
color:#003E69;
margin-left:5px;
}
span.iname_b {
font-weight:bold;
font-size:1.1em;
}
span.iname_a {
color:#333333;
font-weight:bold;
font-size:0.94em;
}
span.sym_p {
font-weight:normal;
white-space:normal;
}
div.affect {
padding-left:15px;
padding-bottom:10px;
font-size:0.87em;
font-style:italic;
line-height:0.75em;
}
div.affected {
padding-left:30px;
padding-top:10px;
}
table.ptable {
border-collapse:collapse;
border:1px outset black;
line-height:1em;
margin-left:15px;
margin-top:3px;
margin-bottom:3px;
width:900px;
}
table.ptable td {
border:1px solid gray;
padding: 3px;
font-size:0.875em;
}
table.vtable {
border-collapse:collapse;
border:1px outset black;
line-height:16px;
margin-left:30px;
margin-top:10px;
}
table.vtable td {
border:1px solid gray;
word-wrap:break-word;
padding: 3px;
font-size:0.875em;
max-width:450px;
vertical-align:top;
}
table.ptable th, table.vtable th {
background-color:#eeeeee;
font-weight:bold;
color:#333333;
font-family:Verdana, Arial;
font-size:0.81em;
border:1px solid gray;
text-align:center;
vertical-align:top;
white-space:nowrap;
padding: 3px;
}
table.summary {
border-collapse:collapse;
border:1px outset black;
}
table.summary th {
background-color:#eeeeee;
font-weight:100;
text-align:left;
font-size:0.94em;
white-space:nowrap;
border:1px inset gray;
padding: 3px;
}
table.summary td {
text-align:right;
white-space:nowrap;
border:1px inset gray;
padding: 3px 5px 3px 10px;
}
span.mangled {
padding-left:15px;
font-size:0.875em;
cursor:text;
color:#444444;
}
span.sym_ver {
color:#333333;
white-space:nowrap;
font-family:"DejaVu Sans Mono", Monospace;
}
span.attr {
color:#333333;
font-weight:100;
}
span.color_p {
font-style:italic;
color:Brown;
}
span.param {
font-style:italic;
}
span.focus_p {
font-style:italic;
/* color:Red; */
background-color:#FFCCCC;
}
span.ttype {
font-weight:100;
}
span.nowrap {
white-space:nowrap;
}
span.value {
white-space:nowrap;
font-weight:bold;
}
td.passed {
background-color:#CCFFCC;
}
td.warning {
background-color:#F4F4AF;
}
td.failed {
background-color:#FFCCCC;
}
td.new {
background-color:#C6DEFF;
}
.top_ref {
font-size:0.69em;
}
.footer {
font-size:0.75em;
}
.tabset {
float:left;
}
a.tab {
border:1px solid Black;
float:left;
margin:0px 5px -1px 0px;
padding:3px 5px 3px 5px;
position:relative;
font-size:0.875em;
background-color:#DDD;
text-decoration:none;
color:Black;
}
a.disabled:hover
{
color:Black;
background:#EEE;
}
a.active:hover
{
color:Black;
background:White;
}
a.active {
border-bottom-color:White;
background-color:White;
}
div.tab {
border-top:1px solid Black;
padding:0px;
width:100%;
clear:both;
}
</style>
<script type="text/javascript" language="JavaScript">
<!--
function showContent(header, id)
{
e = document.getElementById(id);
if(e.style.display == 'none')
{
e.style.display = 'block';
e.style.visibility = 'visible';
header.innerHTML = header.innerHTML.replace(/\[[^0-9 ]\]/gi,"[&minus;]");
}
else
{
e.style.display = 'none';
e.style.visibility = 'hidden';
header.innerHTML = header.innerHTML.replace(/\[[^0-9 ]\]/gi,"[+]");
}
}
function initTabs()
{
var url = window.location.href;
if(url.indexOf('_Source_')!=-1 || url.indexOf('#Source')!=-1)
{
var tab1 = document.getElementById('BinaryID');
var tab2 = document.getElementById('SourceID');
tab1.className='tab disabled';
tab2.className='tab active';
}
var sets = document.getElementsByTagName('div');
for (var i = 0; i < sets.length; i++)
{
if (sets[i].className.indexOf('tabset') != -1)
{
var tabs = [];
var links = sets[i].getElementsByTagName('a');
for (var j = 0; j < links.length; j++)
{
if (links[j].className.indexOf('tab') != -1)
{
tabs.push(links[j]);
links[j].tabs = tabs;
var tab = document.getElementById(links[j].href.substr(links[j].href.indexOf('#') + 1));
//reset all tabs on start
if (tab)
{
if (links[j].className.indexOf('active')!=-1) {
tab.style.display = 'block';
}
else {
tab.style.display = 'none';
}
}
links[j].onclick = function()
{
var tab = document.getElementById(this.href.substr(this.href.indexOf('#') + 1));
if (tab)
{
//reset all tabs before change
for (var k = 0; k < this.tabs.length; k++)
{
document.getElementById(this.tabs[k].href.substr(this.tabs[k].href.indexOf('#') + 1)).style.display = 'none';
this.tabs[k].className = this.tabs[k].className.replace('active', 'disabled');
}
this.className = 'tab active';
tab.style.display = 'block';
// window.location.hash = this.id.replace('ID', '');
return false;
}
}
}
}
}
}
if(url.indexOf('#')!=-1) {
location.href=location.href;
}
}
if (window.addEventListener) window.addEventListener('load', initTabs, false);
else if (window.attachEvent) window.attachEvent('onload', initTabs);
-->
</script>
</head><body><a name='Source'></a><a name='Binary'></a><a name='Top'></a><h1>API compatibility report for the <span style='color:Blue;'>libopenjp2.so</span> object between <span style='color:Red;'>2.1</span> and <span style='color:Red;'>current</span> versions on <span style='color:Blue;'>x86_64</span></h1>
<br/>
<div class='tabset'>
<a id='BinaryID' href='#BinaryTab' class='tab active'>Binary<br/>Compatibility</a>
<a id='SourceID' href='#SourceTab' style='margin-left:3px' class='tab disabled'>Source<br/>Compatibility</a>
</div><div id='BinaryTab' class='tab'>
<h2>Test Info</h2><hr/>
<table class='summary'>
<tr><th>Module Name</th><td>openjpeg</td></tr>
<tr><th>Version #1</th><td>2.1</td></tr>
<tr><th>Version #2</th><td>current</td></tr>
<tr><th>CPU Type</th><td>x86_64</td></tr>
<tr><th>GCC Version</th><td>4.9.2</td></tr>
<tr><th>Subject</th><td width='150px'>Binary Compatibility</td></tr>
</table>
<h2>Test Results</h2><hr/>
<table class='summary'><tr><th>Total Header Files</th><td><a href='#Headers' style='color:Blue;'>1</a></td></tr>
<tr><th>Total Source Files</th><td><a href='#Sources' style='color:Blue;'>3</a></td></tr>
<tr><th>Total Objects</th><td><a href='#Libs' style='color:Blue;'>1</a></td></tr>
<tr><th>Total Symbols / Types</th><td>43 / 110</td></tr>
<tr><th>Verdict</th><td><span style='color:Green;'><b>Compatible</b></span></td></tr>
</table>
<h2>Problem Summary</h2><hr/>
<table class='summary'><tr><th></th><th style='text-align:center;'>Severity</th><th style='text-align:center;'>Count</th></tr><tr><th>Added Symbols</th><td>-</td><td>0</td></tr>
<tr><th>Removed Symbols</th><td>High</td><td>0</td></tr>
<tr><th rowspan='3'>Problems with<br/>Data Types</th><td>High</td><td>0</td></tr>
<tr><td>Medium</td><td>0</td></tr>
<tr><td>Low</td><td>0</td></tr>
<tr><th rowspan='3'>Problems with<br/>Symbols</th><td>High</td><td>0</td></tr>
<tr><td>Medium</td><td>0</td></tr>
<tr><td>Low</td><td>0</td></tr>
<tr><th>Problems with<br/>Constants</th><td>Low</td><td>0</td></tr>
</table>
<a name='Headers'></a><h2>Header Files (1)</h2><hr/>
<div class='h_list'>
openjpeg.h<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<a name='Sources'></a><h2>Source Files (3)</h2><hr/>
<div class='h_list'>
cio.c<br/>
image.c<br/>
openjpeg.c<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<a name='Libs'></a><h2>Objects (1)</h2><hr/>
<div class='lib_list'>
libopenjp2.so.2.1.0<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<br/><br/><br/></div><div id='SourceTab' class='tab'>
<h2>Test Info</h2><hr/>
<table class='summary'>
<tr><th>Module Name</th><td>openjpeg</td></tr>
<tr><th>Version #1</th><td>2.1</td></tr>
<tr><th>Version #2</th><td>current</td></tr>
<tr><th>CPU Type</th><td>x86_64</td></tr>
<tr><th>GCC Version</th><td>4.9.2</td></tr>
<tr><th>Subject</th><td width='150px'>Source Compatibility</td></tr>
</table>
<h2>Test Results</h2><hr/>
<table class='summary'><tr><th>Total Header Files</th><td><a href='#Headers' style='color:Blue;'>1</a></td></tr>
<tr><th>Total Source Files</th><td><a href='#Sources' style='color:Blue;'>3</a></td></tr>
<tr><th>Total Objects</th><td><a href='#Libs' style='color:Blue;'>1</a></td></tr>
<tr><th>Total Symbols / Types</th><td>43 / 110</td></tr>
<tr><th>Verdict</th><td><span style='color:Green;'><b>Compatible</b></span></td></tr>
</table>
<h2>Problem Summary</h2><hr/>
<table class='summary'><tr><th></th><th style='text-align:center;'>Severity</th><th style='text-align:center;'>Count</th></tr><tr><th>Added Symbols</th><td>-</td><td>0</td></tr>
<tr><th>Removed Symbols</th><td>High</td><td>0</td></tr>
<tr><th rowspan='3'>Problems with<br/>Data Types</th><td>High</td><td>0</td></tr>
<tr><td>Medium</td><td>0</td></tr>
<tr><td>Low</td><td>0</td></tr>
<tr><th rowspan='3'>Problems with<br/>Symbols</th><td>High</td><td>0</td></tr>
<tr><td>Medium</td><td>0</td></tr>
<tr><td>Low</td><td>0</td></tr>
<tr><th>Problems with<br/>Constants</th><td>Low</td><td>0</td></tr>
</table>
<a name='Headers'></a><h2>Header Files (1)</h2><hr/>
<div class='h_list'>
openjpeg.h<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<a name='Sources'></a><h2>Source Files (3)</h2><hr/>
<div class='h_list'>
cio.c<br/>
image.c<br/>
openjpeg.c<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<a name='Libs'></a><h2>Objects (1)</h2><hr/>
<div class='lib_list'>
libopenjp2.so.2.1.0<br/>
</div>
<br/><a class='top_ref' href='#Top'>to the top</a><br/>
<br/><br/><br/></div><hr/><div class='footer' align='right'><i>Generated on Mon Jan 25 14:47:00 2016 by <a href='http://lvc.github.io/abi-compliance-checker/'>ABI Compliance Checker</a> 1.99.15 &#160;</i></div><br/>
</body></html>

View File

@ -21,6 +21,30 @@
"PublicSymbols": "public_symbols/openjpeg/current/list",
"PublicTypes": "public_types/openjpeg/current/list"
},
{
"Number": "2.1.2",
"Installed": "installed/openjpeg/2.1.2",
"Source": "src/openjpeg/2.1.2/version.-2.1.2.tar.gz",
"Changelog": "CHANGELOG.md",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/2.1.2/list",
"PublicTypes": "public_types/openjpeg/2.1.2/list"
},
{
"Number": "2.1.1",
"Installed": "installed/openjpeg/2.1.1",
"Source": "src/openjpeg/2.1.1/version.-2.1.1.tar.gz",
"Changelog": "CHANGELOG.md",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/2.1.1/list",
"PublicTypes": "public_types/openjpeg/2.1.1/list"
},
{
"Number": "2.1",
"Installed": "installed/openjpeg/2.1",
@ -92,29 +116,5 @@
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.5/list",
"PublicTypes": "public_types/openjpeg/1.5/list"
},
{
"Number": "1.4",
"Installed": "installed/openjpeg/1.4",
"Source": "src/openjpeg/1.4/version.1.4.tar.gz",
"Changelog": "CHANGES",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.4/list",
"PublicTypes": "public_types/openjpeg/1.4/list"
},
{
"Number": "1.2",
"Installed": "installed/openjpeg/1.2",
"Source": "src/openjpeg/1.2/version.1.2.tar.gz",
"Changelog": "ChangeLog",
"HeadersDiff": "On",
"PkgDiff": "Off",
"ABIView": "Off",
"ABIDiff": "Off",
"PublicSymbols": "public_symbols/openjpeg/1.2/list",
"PublicTypes": "public_types/openjpeg/1.2/list"
}]
}

View File

@ -14,14 +14,19 @@ if [ "${OPJ_CI_ABI_CHECK:-}" != "1" ]; then
fi
OPJ_UPLOAD_ABI_REPORT=0
OPJ_LATEST_VERSION="2.1"
OPJ_LIMIT_ABI_BUILDS="-limit 2"
#OPJ_PREVIOUS_VERSION="2.1.1"
OPJ_LATEST_VERSION="2.1.2"
if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
OPJ_LIMIT_ABI_BUILDS="-limit 3"
else
OPJ_LIMIT_ABI_BUILDS="-limit 2"
fi
OPJ_REPO="https://github.com/uclouvain/openjpeg.git"
OPJ_SSH_REPO=${OPJ_REPO/https:\/\/github.com\//git@github.com:}
OPJ_UPLOAD_BRANCH="gh-pages"
OPJ_UPLOAD_DIR="abi-check"
if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then
if [ "$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/')" == "uclouvain" ] && [ "${TRAVIS_PULL_REQUEST:-}" == "false" ]; then
if [ "$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/')" == "uclouvain" ] && [ "${TRAVIS_PULL_REQUEST:-}" == "false" ] && [ "${TRAVIS_BRANCH:-}" == "master" ]; then
# Upload updated report to gh-pages
OPJ_UPLOAD_ABI_REPORT=1
# Build full report
@ -66,7 +71,7 @@ rm -rf installed/openjpeg/current/*
# Let's create all we need
grep -v Git ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
#abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -get openjpeg.json
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -get openjpeg.json
if [ "${OPJ_LIMIT_ABI_BUILDS}" != "" ]; then
cp -f ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json ./openjpeg.json
else
@ -74,17 +79,27 @@ else
grep -v Configure ${OPJ_SOURCE_DIR}/tools/abi-tracker/openjpeg.json > ./openjpeg.json
fi
cp -rf ${OPJ_SOURCE_DIR} src/openjpeg/current
abi-monitor ${OPJ_LIMIT_ABI_BUILDS} -rebuild openjpeg.json
abi-monitor -v current -build openjpeg.json
abi-monitor -v ${OPJ_LATEST_VERSION} -build openjpeg.json
if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
abi-monitor -v ${OPJ_PREVIOUS_VERSION} -build openjpeg.json
fi
abi-tracker -build openjpeg.json
EXIT_CODE=0
# Check API
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_PREVIOUS_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -header openjpeg.h -api -s || EXIT_CODE=1
fi
# Check ABI
if [ "${OPJ_LIMIT_ABI_BUILDS}" != "" ]; then
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/current -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
if [ "${OPJ_PREVIOUS_VERSION:-}" != "" ]; then
abi-compliance-checker -l openjpeg -old $(find ./abi_dump/openjpeg/$OPJ_PREVIOUS_VERSION -name '*.dump') -new $(find ./abi_dump/openjpeg/$OPJ_LATEST_VERSION -name '*.dump') -header openjpeg.h -abi -s || EXIT_CODE=1
fi
else
echo "Disable ABI check for now, problems with symbol visibility..."
fi

View File

@ -115,33 +115,3 @@ if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then
fi
fi
fi
# Install clang if necessary.
# clang-3.4 is available on base image
# For more up-to-date versions, use packages from http://llvm.org/apt
# Cannot use addons.apt.packages because clang-3.9 is currently on hold
# (see https://github.com/travis-ci/apt-package-whitelist/pull/2780 or https://github.com/travis-ci/apt-package-whitelist/pull/2770)
# "sudo: required" should be set in .travis.yml matrix for those configurations
if echo "${CC:-}" | egrep -q "^clang-3.[7-9]?$" ; then
case "${CC:-}" in
clang-3.7)
echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.7 main" | sudo tee /etc/apt/sources.list.d/llvm.list
;;
clang-3.8)
echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.8 main" | sudo tee /etc/apt/sources.list.d/llvm.list
;;
clang-3.9)
echo "deb http://llvm.org/apt/precise/ llvm-toolchain-precise main" | sudo tee /etc/apt/sources.list.d/llvm.list
;;
*)
echo "We should never have been there. Exiting..."
exit 1
esac
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
# On precise, ubuntu-toolchain ppa must be installed also (see http://llvm.org/apt)
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt-get install "${CC:-}" -y
fi