51 if (first_ifd >= numeric_limits<uint32_t>::max() - 12)
52 ThrowFPE(
"Not Fiff. First IFD too far away");
62 auto subIFD = std::make_unique<TiffIFD>(
rootIFD.get());
64 if (
mInput.isValid(second_ifd)) {
74 if (second_ifd <= first_ifd)
75 ThrowFPE(
"Fiff is corrupted: second IFD is not after the first IFD");
77 uint32_t rawOffset = second_ifd - first_ifd;
78 subIFD->add(std::make_unique<TiffEntryWithData>(
80 Buffer(
reinterpret_cast<const uint8_t*
>(&rawOffset),
83 subIFD->add(std::make_unique<TiffEntryWithData>(
85 Buffer(
reinterpret_cast<const uint8_t*
>(&max_size),
90 if (
mInput.isValid(third_ifd)) {
103 for (
uint32_t i = 0; i < entries; i++) {
123 subIFD->add(std::make_unique<TiffEntry>(
124 subIFD.get(), tag, type, count,
131 rootIFD->add(std::move(subIFD));