76 Commits (02b0ff39d72b020621af27b361da9696068e9322)

Author SHA1 Message Date
Rosen Penev 932d59a984 find_if conversion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse 3ef783e02a
Convert IfdId and SectionId to enum classes. 3 years ago
Luis Díaz Más c3d0100d48 Fixing bad usages of DataBuf (when it is empty) 3 years ago
Rosen Penev 262d0ee4b3 struct to std::pair conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev b72e4b0e44 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 043547cbd0 remove various usages of memset
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 9dc35e7380 find to std::find
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más d7f35e33f0 Remove useless static_casts 3 years ago
Luis Díaz Más ae4df71233 Remove DataBuf::copyBytes and use std::copy instead 3 years ago
Luis Díaz Más b05573fadc Remove most of the asserts from codebase 3 years ago
Luis Díaz Más 30bf563f4d Update .clang-format file & apply clang-format to whole project 3 years ago
Luis Diaz 7576a2757b More size_t for sizes 3 years ago
Luis Diaz 137ea080b5 Change Metadatum::size() return value from long to size_t 3 years ago
Luis Díaz Más 96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 3 years ago
Luis Díaz Más c115d4daf7
Merge pull request #2131 from Exiv2/mainCleanups
Include what you use + more SPDX identifiers + few other cleanups
3 years ago
Rosen Penev 8dadcdf72a manual nullptr removals
unique_ptr has a bool overload. It's also easier to reason about.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más 2834fa5f05 Use [[maybe_unused]] 3 years ago
Rosen Penev 63e41c3aeb clang-tidy: simplify bool
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 6d1fa2ecea clang-tidy: use empty() instead of size()
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 04bacdedd6 clang-tidy: use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 962e3b7369 clang-tidy: use default
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev a5c094b85f clang-tidy: use concat namespaces
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más b17828b454
Use SPDX for licenses (#2122)
* Use SPDX identifier in header files

* Use SPDX identifier in rest of source files

* Fix usage of SPDX for files with 2 licenses

* Add global license file

* Fix compilation
3 years ago
Luis Díaz Más b9f9d041ea Several transformations on DataBuf + migration to size_t
- Provide begin/end iterators to DataBuf and simplify code
- Adapt test output after last changes
- Replacing long by size_t in value.hpp
- Use size_t in some Photoshop functions
- Remove some static_casts
3 years ago
Luis Díaz Más 5d627433fc Remove useless DataBuf::clear() 3 years ago
Luis Díaz Más aec36f86d7 Replace naked new operators 3 years ago
Luis Díaz Más c5a9dfd9af
Merge pull request #2109 from Exiv2/main_StringView
Refactoring & cleanup
3 years ago
Luis Díaz Más 21eb0cec4f Fix build when EXIV2_BUILD_MESSAGES is ON 3 years ago
Luis Díaz Más 76f01fd4d3 Clean more header inclusions 3 years ago
Luis Díaz Más 59f4d0de27 cppcheck: reduce scope of variables 3 years ago
Luis Díaz Más ea201ce613 Remove dead code 3 years ago
Kevin Backhouse 256365830a
Replace Metadatum::toLong() with Metadatum::toInt64(). 3 years ago
Kevin Backhouse 2a3dd2def9
Replace Value::toLong with Value::toInt64. (#2062)
* Replace Value::toLong with Value::toInt64.

* Fix compiler warning.

* Fix compile error.

* Fix declaration of canonEv

* Fix compiler warning.

* Fix compiler warning.

* Use int64_t for offsets in tiffcomposite_int.cpp

* Fix compiler warning.

* Fix compiler warnings.

* Fix compiler warning.

* Fix compiler warning.

* Fix compiler warning.

* Fix compiler warning.

* Remove static_cast<long int> in TagDetails initializer.
3 years ago
Luis Díaz Más 0f03e77634 Simplify code around UniquePtr(s) & use make_unique over new 3 years ago
Luis Díaz Más 9d8dd86945 Use auto to reduce verbosity around code dealing with iterators 3 years ago
Kevin Backhouse 81cfc162c1
Use std::move to transfer ownership of DataBufs. 4 years ago
Kevin Backhouse 5fdd9da3d3
Use =default. 4 years ago
Kevin Backhouse 482cb2ded5
Clarify ownership model of CiffComponent::pData_ 4 years ago
Kevin Backhouse e71b99b236
Merge pull request #1886 from kevinbackhouse/private-pData
Make fields of DataBuf private
4 years ago
Kevin Backhouse bd211a90ac
Credit to OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=37889
Avoid reading 1 byte off the end when the string does not contain a '\0' byte.
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 ad5e6c479c
Extra checking to prevent the loop counter from wrapping around. 4 years ago
Kevin Backhouse fa52d7e2cb Better way to print the error message. 4 years ago
Kevin Backhouse 6685b8db4a Print message to stderr when EXIV2_DEBUG_MESSAGES is enabled. 4 years ago
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