364 Commits (482cb2ded5002e673e58b64907a1b51ca0baf07e)

Author SHA1 Message Date
Kevin Backhouse 9b79b378b1
Remove unused constructor that was causing a build failure in OSS-Fuzz.
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=38491
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
Rosen Penev f3fcffd6e6 remove most usages of std::make_pair
Better alternatives exist with C++11.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Kevin Backhouse 4674fae4ef Safer casting from double to long.
(cherry picked from commit 372e28c41044a9e8b65d7d7093e028e30a7c8c8a)
4 years ago
Kevin Backhouse 2532f6db40
Add `markerHasLength` utility function. 4 years ago
Christoph Hasse 7251a96da6 remove exv_grep_keys_t type alias 4 years ago
Christoph Hasse d82980b563 refactor: replace old linux regex.h with regex from STL. 4 years ago
Kevin Backhouse 02d4ef2c5e
Support for 64-bit box lengths looked broken. 4 years ago
Kevin Backhouse 8c64e9abba
Add `pbox_end` param to `BmffImage::boxHandler` to enforce box nesting. 4 years ago
Kevin Backhouse 5ab3f2b0c5 Defensive coding to avoid 0x80000000/0xFFFFFFFF FPE. 4 years ago
Rosen Penev 3b2a1b9d84 clang-tidy: use braced init list
Found with modernize-return-braced-init-list

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

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 7732b9308e clang-tidy: add explicit
Found with hicpp-explicit-conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 97cf02bf12 clang-tidy: remove redundant specifiers
Found with readability-redundant-access-specifiers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 430ff1c9b8 clang-tidy: replace throw with noexcept
Found with modernize-use-noexcept

Signed-off-by: Rosen Penev <rosenp@gmail.com>
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
Kevin Backhouse 2b84f4bd64
fix: zero initialize local variables. (#1743)
* Zero initialize local variables.

* Initialize xmpID_
4 years ago
Rosen Penev 4a654e4266 clang-tidy: do not use 0 for bool
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 99823a526c clang-tidy: replace virtual with override
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 19000cd53c con/destructor fixes
Added = delete to make it explicit. Also made them public.

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

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

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 17a8d743a5 clang-tidy: do not use else after return
Found with llvm-else-after-return

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

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev c20394b3fa remove old MSVC hacks
This is C++11 now.

Signed-off-by: Rosen Penev <rosenp@gmail.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
Christoph Hasse 758dd6bbc6 refactor!: remove free() function from DataBuf to avoid potential problems, see #1542 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 e5894d71e1 default con/destructors in headers
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 6da49fd29b more constexpr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 036af68a71 remove pointless constructors
Replaced with Uniform initialization. Allows constexpr usage.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8564d0b394 clang-tidy: pass by value
Found with modernize-pass-by-value

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev f9d394adf0 clang-tidy: run through performance checks
Found with performance*

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 4aa5566cf6 clang-tidy: make several member functions const
Found with readability-make-member-function-const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 674fdcd38b clang-tidy: fix declartation names
Found with readability-inconsistent-declaration-parameter-name

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
Luis Díaz Más b675c58bab Move include/CMake to src 4 years ago
tbeu bf0d8114c9 #525: Update comment and fix variable name 4 years ago
tbeu 94420ab591 Remove custom rwlock in favor of `std::mutex` of C++11
Current design on Windows was broken anyway, since legacy class `RWLock` does not implement a proper rwlock (shared read and exclusive write)

Once we are allowed using C++14 features, we can replace the `std::mutex` by `std::shared_timed_mutex` and the read-access locks by `std::shared_lock`.
Once we are allowed using C++17 features, we can replace the `std::mutex` by `std::shared_mutex` and the read-acces locks by `std::shared_lock`.
4 years ago
Miloš Komarčević bc37a6ccb4 Update bmffimage.hpp include order and path
No need to treat it differently since 206a2c495c

(could even back-port to 0.27 if there is RC3 coming)
4 years ago
Luis Díaz Más d5240a4bda eps: Fix code after usage of unique_ptr. Remove deprecation tags 4 years ago
Luis Díaz Más ed6cbf77b4 Revert "eps - do not install header"
This reverts commit 8f16196ad3.
4 years ago
Luis Díaz Más 8314030604 Revert "Remove deprecated EPS format"
This reverts commit 537cdad99e.
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 75bf666d3b Remove typedef to Dictionary::const_iterator 4 years ago
Luis Díaz Más 83dda6ccd7 Fix warnings related to -Wdeprecated-copy 4 years ago
Luis Díaz Más 2de3bad869 Remove EXIV2_ENABLE_VIDEO and related stuff 4 years ago
Luis Díaz Más 3eb1eee7fe Remove deprecated RiffVideo support 4 years ago