Commit Graph

5582 Commits

Author SHA1 Message Date
Luis Diaz Mas
5fa8f5aa87 CMake: minimum version bumped to 3.3.2 2018-06-01 06:55:38 +02:00
Luis Díaz Más
9f67edd9bd Conan: bring libiconv dependency for Windows 2018-06-01 06:55:38 +02:00
Luis Díaz Más
9339cfcac8 CMake: Update FindIconv.cmake.
I've taken this file from the CMake repository directly. Apparently the FindIconv module is available in the latest
CMake versions, but we should not update the CMake requirement for the moment.
2018-06-01 06:55:38 +02:00
Luis Díaz Más
8baf07decb Fix warnins reported by -Wunused-variable
This trick is a bit nasty but I do not want to mess up to much with the
XMPSample application at this moment. Once we have more unit tets for
that part of the code, the xmpsample could disappear.
2018-05-31 14:44:24 +02:00
Luis Díaz Más
e82cd1734c Fix warnings reported by -Wmisleading-indentation 2018-05-31 14:44:24 +02:00
Luis Díaz Más
88ba920962 Extract out common code for two switch-cases into a function to fix warning
The warning was caused by -Wimplicit-fallthrough:
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

I also realized that the method printStructure was duplicated in the
classes Print and Erase. By moving the implementation to a free function
into the cpp file, I could remove the duplication in the code.
2018-05-31 14:44:24 +02:00
Luis Díaz Más
335607054c Use enforce instead of std::assert to fix warning about unused variable in realease mode 2018-05-31 14:44:24 +02:00
Luis Diaz Mas
773bdfd14e Create a header where to keep an unique definition of UNUSED 2018-05-31 14:44:24 +02:00
Luis Díaz Más
9fa4c62561 Appveyor: use conan 1.3.3 2018-05-29 15:33:07 +02:00
Luis Díaz Más
85d021cbe3 Appveyor: cache conanCache folder 2018-05-29 15:33:07 +02:00
D4N
2ab4f72c89
Merge pull request #329 from Exiv2/test_suite_improvements
Test suite improvements:
- the variables defined in the config file are now accessible inside the system_tests namespace
- a new function path was added, that converts unix paths to Windows paths on Windows
- hooks were added to the test suite and are used to remove the usage of $cat
2018-05-29 10:59:11 +02:00
Dan Čermák
d7f4453dbd [testsuite] Remove usage of $cat via hooks 2018-05-29 10:21:13 +02:00
Dan Čermák
41ac25c4f4 [testsuite] Add hooks & documentation for hooks 2018-05-29 10:21:13 +02:00
Dan Čermák
23e29e9527 [testsuite] Use system_tests.path() in some test cases 2018-05-29 10:21:13 +02:00
Dan Čermák
4e32929956 [testsuite] Add notes concerning escaping in commands 2018-05-29 10:21:13 +02:00
Dan Čermák
53c265f8a7 [testsuite] Add path conversion function 2018-05-29 10:21:13 +02:00
Dan Čermák
300b1dc0ef [testsuite] Testsuite injects config file values into its namespace 2018-05-29 10:21:13 +02:00
Luis Diaz Mas
c26135a2da CMake: indicate if XMP external is enabled 2018-05-29 10:03:41 +02:00
Luis Díaz Más
a3a24ce01e Set libstdc++ with Xcode generator when using external XMP 2018-05-29 10:03:41 +02:00
Luis Diaz Mas
b590fa542a Disable 'embedded' XMP when EXIV2_ENABLE_EXTERNAL_XMP is enabled 2018-05-29 10:03:41 +02:00
Luis Díaz Más
1ea0eb83df Remove useless code for Mac 2018-05-29 10:03:41 +02:00
Luis Diaz Mas
88fecdef3e Add additional compiler flags when external XMP is enabled on Mac 2018-05-29 10:03:41 +02:00
Luis Díaz Más
038bffd1dd CMake: Print linker flags in the configuration summary 2018-05-29 10:03:41 +02:00
Luis Díaz Más
93edcc11b3 Doc: Add documentation about how to use the external XMP SDK with conan & cmake 2018-05-29 10:03:41 +02:00
Luis Díaz Más
b53465954a CMake: FATAL_ERROR when both XMP cmake variables are one.
EXIV2_ENABLE_XMP and EXIV2_ENABLE_EXTERNAL_XMP are mutually exclusive.
2018-05-29 10:03:41 +02:00
Luis Díaz Más
9cd8cc0968 conan: Do not bring Expat when xmp=True.
Since the external XMP SDK is already adding the expat sources to the XMPCore library, we do not
need the Expat dependency for Exiv2.
2018-05-29 10:03:41 +02:00
Luis Diaz Mas
96aa7ef3d7 Add info about adding the piponazo's conan repository 2018-05-29 10:03:41 +02:00
Luis Diaz Mas
f2c5fcf49d Format README-CONAN.md file 2018-05-29 10:03:41 +02:00
Luis Diaz Mas
85abdff080 AppVeyor: Remove explicit option EXIV2_ENABLE_XMP. Already ON by default 2018-05-29 10:03:41 +02:00
Luis Diaz Mas
9586928d29 Add CMake code to handle external XMP
Experiment: Try with testing package
2018-05-29 10:03:41 +02:00
D4N
e483856a61
Merge pull request #328 from Exiv2/memory_fixes
Memory issue fixes
2018-05-27 13:25:58 +02:00
Dan Čermák
a1a9c3d79a Use reinterpret_cast instead of C style cast 2018-05-27 12:11:30 +02:00
Dan Čermák
088986e5fa [unit_tests] Remove a memory leak from test_XmpKey.cpp
XmpProperties::registerNs allocates strings on the heap that must be freed
manually via XmpProperties::unregisterNs().
=> do this in TearDownTestCase()
2018-05-27 12:11:30 +02:00
Dan Čermák
b51b6fc52d Prevent an out of bounds read in strstr in JpegBase::printStructure
The xmp byte array is not necessarily null terminated => strstr can read beyond
the bounds of the allocated array then.
Therefore use string_from_unterminated to remedy this issue.
Also replace xmp with a std::vector, as stl functions can throw and we don't
want a memory leak.
2018-05-27 12:11:30 +02:00
Dan Čermák
510560bbd1 Prevent out of bounds read in jpgimage.cpp JpegBase::printStructure
signature is extracted from an image and can lack the terminating \0, this
causes the std::string constructor and strcmp to read beyond the bounds of the
allocated array.
=> Use string_from_unterminated to construct a std::string safely and use it
in the subsequent code & use stl functions instead of C functions
2018-05-27 12:11:10 +02:00
Dan Čermák
dd52b1a832 Add helper_functions.cpp/hpp & unit tests
- add function which constructs a new std::string from a potentially not null
  terminated char *
- add unit tests
2018-05-27 09:38:27 +02:00
Luis Diaz Mas
4713336c93 Add more unit tests for TiffHeader 2018-05-26 18:19:40 +02:00
Luis Diaz Mas
59493d1edc Fix bug in Cr2Header::read 2018-05-26 18:19:40 +02:00
Luis Diaz Mas
b1c34ee11f Add unit tests for Cr2Header 2018-05-26 18:19:40 +02:00
Luis Diaz Mas
1d27c21639 Rename files from cr2image_int to cr2header_int 2018-05-26 18:19:40 +02:00
Luis Diaz Mas
8eca055058 Add POC + regression test.
Note that we override here the method check_no_ASAN_UBSAN_errors to also
analyze the last two lines of got_stderr.
2018-05-26 09:59:37 +02:00
Luis Diaz Mas
67a5a74115 Throw when trying to write out of the buffer 2018-05-26 09:59:37 +02:00
Luis Diaz Mas
863aaebc92 Use index to access buf.pData_ 2018-05-26 09:59:37 +02:00
Luis Diaz Mas
ed874703ad Prevent call to memcpy with size==0 2018-05-26 09:59:37 +02:00
Luis Diaz Mas
f17636460f Remove tags_int.cpp that was not used in the project
I introduced that file accidentally in the project while trying to move
the implementation details to xxx_int.cpp files. In this case, I found
out some issues and I just decided to leave the implementation in the
file tags.cpp.
2018-05-24 19:58:41 +02:00
D4N
89bd7d5ca1
Merge pull request #287 from Exiv2/port_redmine_issues
Port redmine issues 426-825 to the new test suite
2018-05-24 12:37:09 +02:00
Luis Díaz Más
b8b94dc67a Escape characters properly once we started using python literals 2018-05-24 11:06:18 +02:00
Luis Díaz Más
48078e9c8b Fix tests on windows by using os.path.join 2018-05-24 11:06:18 +02:00
Luis Díaz Más
72faa7331d Fix issues with python strings & literals 2018-05-24 11:06:18 +02:00
Dan Čermák
90c8d754b7 [testsuite] Call subprocess.Popen() with shell=True on Windows 2018-05-24 11:06:18 +02:00