Commit Graph

8401 Commits

Author SHA1 Message Date
Luis Díaz Más
1a3e93856b More tests for rational convertions 2022-04-14 10:41:00 +02:00
Luis Díaz Más
8da71e7133 Test parseUint32 and fix it when number is out of limits 2022-04-14 10:41:00 +02:00
Luis Díaz Más
331924612e Remove duplication by using templates 2022-04-14 10:40:59 +02:00
Luis Díaz Más
2b91b5daf9 More tests for DataBuf read/write functions 2022-04-14 10:40:59 +02:00
Luis Díaz Más
6964f5f9f2 DataBuf::c_data() returns nullptr when empty + avoid duplication
After the previous commit, I realized that std::vector::data() also
returns nullptr when the vector is empty. So I decided to emulate this
behavior in DataBuf::c_data().

Anyways, the changes done in the previous commit are valid and allow us
to avoid some processing when the DataBuf is empty.
2022-04-14 10:40:58 +02:00
Luis Díaz Más
c3d0100d48 Fixing bad usages of DataBuf (when it is empty) 2022-04-14 10:40:58 +02:00
Luis Díaz Más
4a4a8c544c Throwing when trying to access TooFar elements in DataBuf 2022-04-14 10:40:57 +02:00
Luis Díaz Más
941017d281
Fix issues on ARM builds (#2205)
* Specify base class initialization in Copy Constructor

* Fix printing of uint64_t variable in ARM 32bits

Use cinttypes

* Fix alignment issues on ARM 32 bits

* tests: add assertion with custom message
2022-04-13 15:22:22 +02:00
Rosen Penev
6203ded16f add constexpr constructor
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-13 08:02:30 +02:00
Miloš Komarčević
6c99577f1d
Merge pull request #2203 from Alan01/patch-1
Create da.po
2022-04-12 10:27:00 +02:00
Rosen Penev
8d2e1926ca remove unused class declarations
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-12 08:47:54 +02:00
Luis Díaz Más
25c47cd1cf
Merge pull request #2197 from Exiv2/mainRefactoringFormats
Refactoring in JpegImage and Photoshop classes
2022-04-10 13:23:33 +02:00
Luis Díaz Más
84ba579af4
Merge pull request #2200 from neheb/3
clang-tidy with headers
2022-04-10 13:22:43 +02:00
Luis Díaz Más
f07c88de5d Use .front() to avoid warning from static analysis 2022-04-10 10:55:14 +02:00
Luis Díaz Más
4d99c2aca1 Use std::pair to return multiple values 2022-04-10 10:55:13 +02:00
Luis Díaz Más
4ee9c35799 Include missing iostream header in photoshop.cpp 2022-04-10 10:55:13 +02:00
Luis Díaz Más
f942ba89bd Move Photoshopb class to internal namespace 2022-04-10 10:55:10 +02:00
Luis Diaz
047f6b733e Change logic to determine if segment has size
Note that the failing tests that had to be adapted were bad formed files
from FUZZERs. We should not consider invalid markers like 0x00 or 0x52
but only undefined APPn markers.
2022-04-10 10:53:36 +02:00
Luis Diaz
400632f27b Factor out function readSegmentSize() 2022-04-10 10:53:35 +02:00
Luis Diaz
24d2a7b8f0 JpegBase::markerHasLength moved to implementation details 2022-04-10 10:53:35 +02:00
Luis Diaz
23fe743d4d Move private constants to .cpp 2022-04-10 10:53:34 +02:00
Luis Diaz
b00e460d76 Move static functions to anonymous namespace 2022-04-10 10:53:34 +02:00
Rosen Penev
c997b09a81 algorithm conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
d789968e90 replace malloc/free with new/delete
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
b53ed72fd8 clang-tidy: manual special functions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
a20ace20fc clang-tidy: manual clang-tidy fixes
clang-tidy has issues applying these.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
ae66ecec0d clang-tidy: use nullptr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
49bf7e1387 clang-tidy: use delete
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
e654b2931c clang-tidy: replace throw() with noexcept
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
1f05448d0e clang-tidy: default member init
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:39 -07:00
Rosen Penev
0d971e98e4 remove some unique_ptrs
They're not really used as pointers.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-10 01:40:34 -07:00
Luis Díaz Más
053f516072
Merge pull request #2198 from neheb/3
some clang-tidy
2022-04-10 08:02:34 +02:00
Rosen Penev
89b8d4ea4e try to actually fix null pointer deref
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 12:20:18 -07:00
Rosen Penev
25ef5d7e77 replace ret variable with return statement
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 12:19:38 -07:00
Rosen Penev
7bc9861301 clang-tidy: use strcmmp properly
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 12:19:38 -07:00
Rosen Penev
7a826ac529 clang-tidy: add parentheses to macros
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 12:19:38 -07:00
Rosen Penev
cacb54eaba use auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 12:19:38 -07:00
Rosen Penev
fdfcde5e4b structured binding conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-09 10:49:02 +02:00
Luis Diaz
bd0eefdab7 ci: Try to fix job which is killed due to low memory? 2022-04-07 07:41:55 +02:00
Luis Díaz Más
235bf522b2
Merge pull request #2181 from Exiv2/main_issue2179
[main] Fix integer overflow #2179
2022-04-06 16:27:07 +02:00
Luis Diaz
a505d6f06c More unit tests for Photoshop methods 2022-04-06 15:55:31 +02:00
Luis Diaz
8ab7800477 Remove 2nd param from Photoshop::isIrb() since it is always hardcoded 2022-04-06 15:55:29 +02:00
Luis Diaz
7366a64d44 Add unit tests for Photoshop::isIrb().
It has been detected that we need to always pass the size==4 in the call
to isIrb. Probably it is better to remove that parameter and document
that it is assumed for the buffer to have a length of 4 bytes.
2022-04-06 15:18:43 +02:00
Luis Diaz
a698c3fc08 Remove deprecated variable 2022-04-06 15:18:43 +02:00
Luis Diaz
459c73c0f6 doxygen: update doc style in Photoshop class 2022-04-06 15:18:42 +02:00
Luis Díaz Más
e715243aa5 Fix integer overflow #2179 2022-04-06 15:18:42 +02:00
Luis Díaz Más
6e9eca445a
Merge pull request #2177 from neheb/1
clang-tidy and manual stuff
2022-04-06 14:53:33 +02:00
Luis Díaz Más
04e5f282f9 Link fuzz app against std::filesystem libraries 2022-04-04 13:05:49 +02:00
Luis Díaz Más
3f496bd264
Merge pull request #2191 from Exiv2/main_fix2190
Detect integer-overflow and throw in that case
2022-04-04 11:33:42 +02:00
Luis Díaz Más
3795e5318b Add POC file 2022-04-04 10:03:37 +02:00