Commit Graph

32 Commits

Author SHA1 Message Date
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