238 Commits (0f1ea7571bcc4b291ed2a8a1baefa0dc8bc93c59)

Author SHA1 Message Date
Luis Díaz Más b0318c36be
Upgrade C++ standard to c++17 (#2052)
* Enable C++17 and use new inline specifier for const variable members

* Silence deprecation warning on MSVC

* Disable samples by default

* improvements after review
3 years ago
Kevin Backhouse 68473d9d10
Remove static functions readOrThrow and seekOrThrow. 4 years ago
Kevin Backhouse 44542a9f94
Add readOrThrow and seekOrThrow to BasicIo. 4 years ago
Kevin Backhouse 81cfc162c1
Use std::move to transfer ownership of DataBufs. 4 years ago
Kevin Backhouse 9ff72e5ca5
Make offset=0 the default parameter. 4 years ago
Kevin Backhouse c9d0cf3643
Make fields of DataBuf private. 4 years ago
Kevin Backhouse 64fe77673f
Decouple EXIV2_BUILD_FUZZ_TESTS from EXIV2_TEAM_USE_SANITIZERS. 4 years ago
Kevin Backhouse dd4659ce2d Add bounds-check to prevent out-of-bounds read in memcmp.
(cherry picked from commit a6253799d4e3727e32e6412798dceca4200efdda)
4 years ago
Kevin Backhouse 593fcbd865
Add fuzzing dictionary and test all printStructure() options 4 years ago
Kevin Backhouse 35a2b25d64
Fix build error when EXIV2_DEBUG_MESSAGES is enabled. 4 years ago
Kevin Backhouse 2532f6db40
Add `markerHasLength` utility function. 4 years ago
Kevin Backhouse 96b85751ee
Add comment to explain bounds-check. 4 years ago
Kevin Backhouse 10bd09871f
Update src/jpgimage.cpp
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
4 years ago
Kevin Backhouse fed192dc97
Fix compiler warning. 4 years ago
Kevin Backhouse 483a1497a0
Improved handling of jpg segments to avoid out-of-bound reads. 4 years ago
Kevin Backhouse deb41bd117
bufRead needs to be adjusted after seek() 4 years ago
Kevin Backhouse 9004fb5a97 Remove redundant check.
(cherry picked from commit 19026fab2bc2b6dee2150f38153feb65a41cea17)
4 years ago
Kevin Backhouse 07225c05ee Make sure that read is complete to prevent infinite loop.
(cherry picked from commit ffe5eb517dad93845e62144d8e53f52b17420ecd)
4 years ago
Kevin Backhouse bf786f4cc6
Updates to make fuzzing work. 4 years ago
Kevin Backhouse b16cd52b88 Replace sprintf with snprintf. 4 years ago
Luis Díaz Más f30022d73d
Fix issues detected with PVS-Studio + other little improvements (#1689)
* avoid re-declaration of constant variables

* Replace pthreads critical section with std::mutex

* ci - better naming

* cmake - increase minimum version to 3.11. Use project DESCRIPTION

* fix - do not treat string::find() return type as bool

* remove conditions that were always true

* remove condition that were always false

* Remove EXV_HAVE_GMTIME_R which is not used anymore

* pixelWidth_ was inherited from Exiv2::Image

The width & height variables in the TiffImage class need to be mutable
to be able to change their values on the getters pixelHeight() and
pixelWidth() ... Do not ask me why ...

* Remove superfluous if

* pvs:V766 item with identical key added already

* pvs:V730 not all members were initialized (time)

* pvs:V730 not all members are initialized

* pvs:v668 no point in testing pointer against null after new

* pvs:V1048 variable assigned the same value

* replace c-style dynamic vector with std one

* pvs:547 fakeData is always true

* Remove useless constructor in derived class

* pvs:V690 modern way to disable copy-ctor

* Replace malloc/free with new/delete. No need to check for null

* pvs:V1028 cast operands and not result

* Remove custom MIN/MAX functions

* pvs:V595 pointer used before verified against null

* pvs: index used before being checked

* pvs:V1028 possible overflow. Cast operands

* pvs:v575 potential null pointer passed to other functions

* pvs:V547 deal with always true/false expressions

* pvs:V560 part of conditional expressions always false or true

* pvs:V701 possible break in realloc -> move to std::vector

* Make some classes 'final'

* Replace sprintf with std::to_string()

* fix compilation on windows
4 years ago
Rosen Penev 2c57f214c5 clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 86c71ae6c3 clang-tidy: avoid global non const variables
Found with cppcoreguidelines-avoid-non-const-global-variables

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 743da1a564 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev ff39473c18 clang-tidy: convert to static
Found with readability-convert-member-functions-to-static

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev b8712188bb clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev fdf9d3799c clang-tidy: don't use else after return
Found with llvm-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 143a1fbbe2 clang-tidy: don't use string compare
Found with readability-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8337462032 clang-tidy: use empty() instead of comparing size
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 1dc1186760 clang-tidy: simplify boolean expressions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 4ceb325c8f clang-tidy: range for loop conversions
Found with modernize-loop-convert

Ran through git clang-format.

Also removed several questionable loops and replaced with simpler
algorithms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Luis Díaz Más 75e4bd9059 Remove rest of useless typedefs from datasets.hpp 4 years ago
Luis Díaz Más 01a3bc716d Fix warnings in VS 4 years ago
Luis Díaz Más 0a1bf46a1c revert changes that are affecting to VS 4 years ago
Luis Díaz Más de4d43d4d1 Fix warnings EXIV2_TEAM_EXTRA_WARNINGS
Most of the warnings fixed were:
- Hiding of local variables
- Hiding of globals
- Useless casts
- Conversions between float/double
4 years ago
Luis Díaz Más 0bbaa6eff3 cpp: Replace auto_ptr by unique_ptr 4 years ago
Robin Mills d632988bbd Massive code prolog cleanup. 4 years ago
Ingo Weyrich a6a47346a8 Use a.rfind(b, 0) == 0 instead of a.find(b) == 0 to reduce processing time when checking that a starts wit b, #1459 4 years ago
Luis Díaz Más 20a9e5affe Fix format-overflow warnings by using bigger buffer 6 years ago
Luis Díaz Más 113136e134 Replace DEBUG with EXIV2_DEBUG_MESSAGES
Fixes #926
6 years ago
Kevin Backhouse 80cd0d2990 Add bounds check on allocation size. (#854) 6 years ago
Luis Diaz Mas 6f8d8e3da6 cleanup header inclusions in API 7 years ago
Luis Diaz Mas 83bb4aa80a code formatting 7 years ago
Dan Čermák 962962a8e9 Port Iptc::printStructure & getUshort to slices API
This fixes #211, #210, #209
7 years ago
Dan Čermák fec6535ae8 [binaryToString] Reimplement using Slices
- reimplement binaryToString:
  - it now accepts a Slice and nothing else
  - it does not return a std::string but instead a proxy object that implements
    operator<< (this should be more efficient, as we do not need to touch the
    heap in most cases)
- addapt unit tests
- replace all occurences with the new API
7 years ago
Luis Díaz Más 603692a1d8 Copyright to Exiv2 authors 7 years ago
Luis Díaz Más 6b77e9f6c8 Do not use std::vector::data() which is not part of c++98 7 years ago
tbeu 75cdbc8b91 Use pre-increment on iterators
V803 Decreased performance. In case 'userEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 405
V803 Decreased performance. In case 'authEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 410
V803 Decreased performance. In case 'hostEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 428
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 711
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 841
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 958
V803 Decreased performance. In case 'i' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 855
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. jpgimage.cpp 817
V803 Decreased performance. In case 'lib' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 508
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 563
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. xmpsidecar.cpp 138
7 years ago
Dan Čermák a1a9c3d79a Use reinterpret_cast instead of C style cast 7 years ago
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.
7 years ago
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
7 years ago
Luis Díaz Más 858c99b4df Add enforce before calling REPORT_MARKER with invalid marker 7 years ago
Luis Díaz Más 5e5d76ad0a clang format function 7 years ago
Dan Čermák efe2ccdcb6 Replaced all hardcoded error codes with ker... constants 7 years ago
tbeu 5b5987a596 Remove obsolete EXIV2_RCSID 8 years ago
tbeu 5df8b01b77 Remove obsolete svn revision 8 years ago
Robin Mills 559ace375b #1291 Reverting change in r4763 relating to windows.h as they break the Cygwin build. Retain changes in exiv2/exiv2.hpp and exv_msvc.h 8 years ago
Robin Mills f36cccefa2 #1291 include header simplification 8 years ago
Robin Mills 307c9e266c #1286 Correction to r4752 8 years ago
Robin Mills 5a5f7dc1ac #1286 Fix submitted. 8 years ago
Robin Mills 0051366df4 #1279 Removing unused code. 8 years ago
Robin Mills 192a2a83cf #1279 Cleaned up doxygen warnings for doc and website. 8 years ago
Robin Mills 6d5c2c3256 Getting ready to release v0.26 8 years ago
Robin Mills 2ebacb6b0b #1272 Use in-memory temporary files. 8 years ago
Robin Mills 9ad811150d #1230 Removing incorrect 2-byte pad following JPEG ICC_PROFILE. 9 years ago
Robin Mills 6ea3b00b02 #1249 Fixes 9 years ago
Robin Mills f5956d5db2 #1230 Fixes to read tiff with web-ready. Includes the BasicIo expiremental API readUnmarked() and markRead() which I will remove later. 9 years ago
Robin Mills 5f1d52e497 #1230 Added stdin-test and fixing issue identified by the test. 9 years ago
Robin Mills f4feff0864 #1229. Fix submitted (and appropriate update to test harness). Fix an error in jpgimage::doWriteMetadata for large (>64k) ICC profiles. 9 years ago
Robin Mills 5edc759cc9 #1074 For discussion see: http://dev.exiv2.org/issues/1074#note-23 9 years ago
Robin Mills a8c51889b8 #1074. Fix bug in jpgimage.cpp/readMetadata() concerning ICC profile 9 years ago
Robin Mills 3d57bbc6e6 #1074 Work in progress. ICC Jpeg/Png/Tiff exiv2 -eC foo.xxx writes good foo.icc profiles. icc-test.sh is broken and to be investigated. 9 years ago
Robin Mills 9ff2224fd7 #1074. Rollback r4479 which has inflicted a lot harm on the test harness. 9 years ago
Robin Mills 3aaebf50f7 #1074 Added ICC support to tiffimage.writeMetadata(). pngimage.readMetadata() is not complete. 9 years ago
Robin Mills 14f7f18222 #1057 Correction to r4633 to fix Windows build-breakers (Cygwin/MinGW and msvc) 9 years ago
Robin Mills 57ee93886a #2120 Fix submitted and appropriate changes to test/icc-test.sh (rewritting ICC in JPG was corrupting file) 9 years ago
Robin Mills 87e9c996a6 #1220 and #1074 Work in progress. Improved -pS for JPEG. #1220 is due to a bug in writing the ICC profile in jpgimage.cpp/doWriteMetadata() 9 years ago
Robin Mills 3706233c8d #1074 Correction to r4457 to fix msvc build-breaker. 9 years ago
Robin Mills b7c90140c7 #1074 ICC support in jpgimage.cpp. Add test/icc-test.sh 9 years ago
Robin Mills 9026954816 #1074 Work in progress for ICC/jpg - changes to readMetadata() and printStructure() 9 years ago
Robin Mills fe6a016957 #922 Correction to r4434. Fixing another msvc build breaker. 9 years ago
Robin Mills 8377456786 #922 Correction to r4344 to handle msvc build breaker. 9 years ago
Robin Mills 13be017d12 #922 exiv2 -dI deletes all IPTC chunks in a JPEG. 9 years ago
Robin Mills 06eabfdd88 #1074. jpgimage.cpp ICC support (Work in Progress) 9 years ago
Robin Mills 09c734fbcd #1108. Refactored the IPTC printStructure code from png/jpeg/tiff into iptc.cpp 9 years ago
Robin Mills bdf8d3ad5b #1108 Added photoshop/iptc parser to png/jpeg parser. 9 years ago
Robin Mills 8e7eaa65a7 #1057, #1064, #922, #1148. Work in progress. This is a composite patch of several matters in development. None are totally complete at this time. 9 years ago
Robin Mills a769e1a0fc #1159. Fixing MSVC build-breaker in r4197 and r4179.
Two different issues:
r4197 include <windef.h> does not compile with MSVC 2005 and changed to <windows.h>
r4179 has a short/long compare mismatch
MSVC is a severe build environment and treats warnings as errors.  MSVC is not fragile, it's robust.
10 years ago
Robin Mills 1956b236cd #1159. Thank You, Jakub for discovering this issue and for providing a patch. 10 years ago
Robin Mills b703575389 #1149. Added fff.h (from plir.com) and code strengthening. 10 years ago
Robin Mills a57a9b2fa4 #1149. Modify -pR to find and report the tiff in an APP1/FLIR segment. 10 years ago
Robin Mills 178d0f5fc6 #1148. Fixed formatting error in jpgimage/-pS code. 10 years ago
Robin Mills f49dd0b95f #1108 and #1074 Correction to r4165 to fix MSVC build breaker and to document: exiv2 -eC (extract ICC profile). 10 years ago
Robin Mills fd5e983746 r1108 Recursively dump an image (exiv2 -pR file...) 10 years ago
Robin Mills 6808b073f3 #1074. Implemented exiv2 options -eC and -pC for JPEG. 10 years ago
Andreas Huggel 006625e116 Removed helper functions binaryToString() and stringFormat() from the API and from class Image and made them internal helpers. Renamed type printStructureOption_e to PrintStructureOption to conform with the common naming convention. 10 years ago
Andreas Huggel fd80993ab0 Updated copyright notice. 10 years ago
Robin Mills f1362f9250 #922. Don't remove blank lines from XMP. This is not Exiv2's business. -pX extracts XMP packet without modification. 10 years ago
Robin Mills 40ffba6033 #922 -pS and -pX support for TIFF. Added formatters to Image class and use them from {jpg/png/tiff}image.cpp 10 years ago
Robin Mills f6c79a0d20 #922. Work in progress on options -pS and -pX 10 years ago