Commit Graph

49 Commits

Author SHA1 Message Date
Luis Diaz Mas
6f8d8e3da6 cleanup header inclusions in API 2019-01-11 15:55:25 +01:00
Robin Mills
a9404154bc Fix: https://github.com/Exiv2/exiv2/issues/585 2018-12-09 18:54:40 +01:00
Robin Mills
a33041a8b7 Fix: https://github.com/Exiv2/exiv2/issues/562 for stringFormat() crashes. 2018-12-09 18:54:40 +01:00
Dan Čermák
962962a8e9 Port Iptc::printStructure & getUshort to slices API
This fixes #211, #210, #209
2018-10-11 14:06:16 +02:00
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
2018-10-11 14:06:16 +02:00
Dan Čermák
67ec90bdab Fix switch value in BigTiffImage::readData
This function extracts a 2, 4 or 8 byte integer from the image and
swaps it according to the current setting. However, it was implicitly
assuming, that it reads the same amount from the image is is
requested.
If that is not the case, e.g. if 8 bytes are requested but
only 4 are read
=> result is created via byteSwap8() which reads 8 bytes
   !but 4 of those are uninitialized!
Using the actually read size fixes this problem.
2018-09-13 11:18:29 +02:00
Dan Čermák
ecf955812d Replace reachable assertions with enforce in BigTiffImage::readData 2018-09-13 11:18:29 +02:00
Dan Čermák
b3199a0720 Fix division by zero in BigTiffImage::printIFD
This fixes #262
2018-09-13 11:18:29 +02:00
Luis Díaz Más
dba48ac3d9 Fix warning on VS2008 2018-09-12 19:22:31 +02:00
Luis Díaz Más
4161099b91 Fix warnings reported by MSVC 2018-09-10 10:31:00 +02:00
Dan Čermák
222c65be63 Refactor Nikon case in bigtiffimage
- remove name shadowing
- user std::vector<> instead of raw array
2018-05-16 10:15:53 +02:00
Dan Čermák
efe2ccdcb6 Replaced all hardcoded error codes with ker... constants 2018-02-18 09:28:57 +01:00
Michał Walenciak
d219e61586 be more error prone 2018-01-17 19:07:41 +01:00
Michał Walenciak
24348e85ca checks for valid reads 2018-01-15 21:44:41 +01:00
Michał Walenciak
421c6d6723 improvements for issue #208 2018-01-14 08:24:26 +01:00
Michał Walenciak
1647908e00 fix for crash in bigtiff (issue #208) 2018-01-13 11:44:31 +01:00
Luis Díaz Más
1fe8d5ba7f Fix conversion issue detected by MSVC 2017-11-12 09:54:17 +01:00
Michał Walenciak
2402a693fd adding missing include for numeric_limits 2017-10-06 11:27:46 +02:00
Michał Walenciak
b1a5d615c5 removing debug message 2017-10-04 22:46:43 +02:00
Michał Walenciak
64e05c0a7a improving fixes for #55 and #56 2017-10-04 22:46:20 +02:00
Dan Čermák
74cb5bab13 Fixed wrong brackets: size*count + pad can overflow before the cast
=> Should fix #76 (most of the work has been done by Robin Mills in
   6e3855aed7)

The problem with #76 is the contents of the 26th IFD, with the
following contents:
tag: 0x8649
type: 0x1
count: 0xffff ffff
offset: 0x4974

The issue is the size of count (uint32_t), as adding anything to it
causes an overflow. Especially the expression:
(size*count + pad+20)
results in an overflow and gives 20 as a result instead of
0x100000014, thus the condition in the if in the next line is false
and the program continues to run (until it crashes at io.read).

To properly account for the overflow, the brackets have to be removed,
as then the result is saved in the correctly sized type and not cast
after being calculated in the smaller type.

The brackets have also been removed from bigtiffimage.cpp, where the
same issue is present.
2017-09-27 23:38:49 +02:00
Robin Mills
d8ae4484ae msvc support for bigtiffimage.cpp 2017-09-27 12:24:41 +01:00
clanmills
6e3855aed7 Fix https://github.com/Exiv2/exiv2/issues/55 2017-09-27 09:20:13 +01:00
Michał Walenciak
4837d8cf58 changing header + some warning fix 2017-09-22 21:22:55 +02:00
Michał Walenciak
734a2c3d57 fixing TODO 2017-09-21 18:15:12 +02:00
Michał Walenciak
e3ff1ba694 fixing indent 2017-09-21 18:15:12 +02:00
Michał Walenciak
4629227358 fix for IPTCNAA
dir_offset was used instead of offset
2017-09-21 18:15:12 +02:00
Michał Walenciak
4f6f5b4946 removing conditional_byte_swap* functions 2017-09-21 18:15:12 +02:00
Michał Walenciak
f96d84ba8c dropping dead code 2017-09-21 18:15:12 +02:00
Michał Walenciak
50ecf672b5 using Internal::indent() 2017-09-21 18:15:12 +02:00
Michał Walenciak
f8ac7a5dc3 renaming Tiff to StandardTiff 2017-09-21 18:15:12 +02:00
Michał Walenciak
d460bbdb3f fix for standard tiff case 2017-09-21 18:15:12 +02:00
Michał Walenciak
81aa8828e0 applying dff941ad7f 2017-09-21 18:15:12 +02:00
Michał Walenciak
874daede53 fixing broken print for 'offset' column 2017-09-21 18:15:12 +02:00
Michał Walenciak
8b07982bf2 variable names cleanup 2017-09-21 18:15:12 +02:00
Michał Walenciak
1a1dc3afd4 simplifying code 2017-09-21 18:15:12 +02:00
Michał Walenciak
c6cbf69c49 first attempt to read both - standard and big tiff 2017-09-21 18:15:12 +02:00
Michał Walenciak
972e302cba some cleanups 2017-09-21 18:15:12 +02:00
Michał Walenciak
3c9817339a Dropping BasicIo& io parameter.
We already have acces to it via Image class
2017-09-21 18:15:12 +02:00
Michał Walenciak
65722a0020 dropping bSwap parameter
Member is better.
2017-09-21 18:15:12 +02:00
Michał Walenciak
7e291ef226 Encapsulating Header's members 2017-09-21 18:15:12 +02:00
Michał Walenciak
cb3857c675 removing useles code 2017-09-21 18:15:12 +02:00
Michał Walenciak
ff21b5a962 restore position if necessary 2017-09-21 18:15:12 +02:00
Michał Walenciak
cc8c470620 fix header read + tag name dump 2017-09-21 18:15:12 +02:00
Michał Walenciak
5fa328737a moving implementation from stand alone parser 2017-09-21 18:15:12 +02:00
Michał Walenciak
307faae830 introducing tiff Header + header builder function 2017-09-21 18:15:12 +02:00
Michał Walenciak
dc331ee44a implementing isBigTiffType 2017-09-21 18:15:12 +02:00
Michał Walenciak
b3aa2adf31 initial implementation of newBigTiffInstance() 2017-09-21 18:15:12 +02:00
Michał Walenciak
bc6eed0b03 registering new file type 2017-09-21 18:15:12 +02:00