81 Commits (5e20467e5cd6fbfb522b5afac5490e6fa46b49c3)

Author SHA1 Message Date
Kevin Backhouse f724f4e2fc Don't crash if s > size. 4 years ago
Kevin Backhouse c2b52119d4 Check that findKey didn't return end(). 4 years ago
mergify[bot] 1d64f482ff
fix: use vector::at() rather than operator[] (backport #1735) (#1741)
* fix: use vector::at() rather than operator[] (#1735)

* Regression test for https://github.com/Exiv2/exiv2/issues/1706

* Use vector::at() rather than operator[].

* Print to stderr when exception is caught and EXIV2_DEBUG_MESSAGES is enabled.

* Check that it prints "Bad value" for the date.

(cherry picked from commit f4d3adbf91e6dc4e34aee5bac7b7fd9e127a5c00)

# Conflicts:
#	src/value.cpp

* fix merge conflicts from mergify backport

Co-authored-by: Kevin Backhouse <kevinbackhouse@github.com>
Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com>
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 6da49fd29b more constexpr
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 20dfab8036 manual for range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 1b9b77c51f clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 2e73aa9dc0 default con/destructors in headers
Helps to optimize trivially destructable stuff.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8128716287 clang-tidy: use = default
Found with modernize-use-equals-default

Ran through git clang-format

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Luis Díaz Más f85f7f717a Replace many of the iterators types with auto 4 years ago
Luis Díaz Más 0bbaa6eff3 cpp: Replace auto_ptr by unique_ptr 4 years ago
Kevin Backhouse 9b7a19f957
Fix integer overflow. 4 years ago
Kevin Backhouse 0a91b56616
Fix incorrect delete. 4 years ago
Robin Mills d632988bbd Massive code prolog cleanup. 4 years ago
clanmills 6d7a5266ea fix_1219_mingw_crw_date_0.27 5 years ago
clanmills 698b418f73 fix_1097_0.27 5 years ago
derselbst 70b0c17421 Fix a memory leak in CiffHeader::read()
Memory for pPadding_ was allocated with new[] .
6 years ago
Jens Georg b7890776c6 crwimage: Check offset and size against total size
Corrupted or specially crafted CRW images might exceed the overall
buffersize.

Fixes #1019

(cherry picked from commit 683451567284005cd24e1ccb0a76ca401000968b)
6 years ago
Luis Díaz Más 113136e134 Replace DEBUG with EXIV2_DEBUG_MESSAGES
Fixes #926
6 years ago
Kevin Backhouse 7798ae2557 Throw an exception if the data location is invalid. (#842) 6 years ago
Kevin Backhouse c0ecc2ae36 Avoid integer overflow. 6 years ago
Luis Diaz Mas 6f8d8e3da6 cleanup header inclusions in API 7 years ago
Robin Mills b3d077dcae Fix #460 by adding more checks in CiffDirectory::readDirectory 7 years ago
Luis Díaz Más c4cc019dff Hide -Wunused-variable issues by using the UNUSED() macro 7 years ago
Luis Diaz Mas 8b47a8efc1 Include timegh.h in file which needs it 7 years ago
Luis Diaz Mas a9c9451588 Remove localtime.c and any other trick to handle timegm 7 years ago
tbeu e5a4f1cf35 Use auxiliary variable
V807 Decreased performance. Consider creating a reference to avoid using the 'image.exifData()' expression repeatedly. crwimage.cpp 1320
7 years ago
Dan Čermák efe2ccdcb6 Replaced all hardcoded error codes with ker... constants 7 years ago
Luis Díaz Más d3748152a7 add _int suffix to all the internal files 8 years ago