Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
|
4937166940 | 1 month ago |
@ -1 +1 @@
|
||||
SOURCES/qtimageformats-everywhere-opensource-src-5.15.9.tar.xz
|
||||
SOURCES/qtimageformats-everywhere-opensource-src-5.15.15.tar.xz
|
||||
|
@ -1 +1 @@
|
||||
18ad34b40208609b3964cc6d0317f12f57410119 SOURCES/qtimageformats-everywhere-opensource-src-5.15.9.tar.xz
|
||||
a14130da3757ef495cf90a52c61044de1482dca1 SOURCES/qtimageformats-everywhere-opensource-src-5.15.15.tar.xz
|
||||
|
@ -0,0 +1,104 @@
|
||||
From ebcd7aa43e16a18e795dc0720c4821467ca694fe Mon Sep 17 00:00:00 2001
|
||||
From: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
||||
Date: Thu, 8 Sep 2022 14:52:19 +0200
|
||||
Subject: [PATCH 1/4] webp: support sequential input device if full file is
|
||||
available
|
||||
|
||||
Since we do no random access during decoding, just a readAll() of the
|
||||
whole image file. So if it is all available already, we can handle a
|
||||
sequential device. That is useful for Quick AnimationImage, which will
|
||||
pass a finished QNetworkReply as the input device.
|
||||
|
||||
This commit removes some seek() calls in the header checking, that
|
||||
supposedly should reset the device position. These were in practice
|
||||
either no-ops or bugs, since the device is only being peeked, so the
|
||||
position never changes in the first place, and a QImageIOHandler is
|
||||
supposed to read from the device at the position it is at when passed.
|
||||
|
||||
Fixes: QTBUG-70245
|
||||
Change-Id: I5a4ff5fa4bbd19b0545ad41645969d714b4dc7d5
|
||||
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
||||
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
||||
|
||||
|
||||
(cherry picked from commit 369be99d82a7c1182e3693756ab545cea86bb90d)
|
||||
---
|
||||
.../imageformats/webp/qwebphandler.cpp | 29 +++++++++----------
|
||||
1 file changed, 14 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/imageformats/webp/qwebphandler.cpp b/src/plugins/imageformats/webp/qwebphandler.cpp
|
||||
index 82d38cb..d02eb05 100644
|
||||
--- a/src/plugins/imageformats/webp/qwebphandler.cpp
|
||||
+++ b/src/plugins/imageformats/webp/qwebphandler.cpp
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <qdebug.h>
|
||||
#include <qpainter.h>
|
||||
#include <qvariant.h>
|
||||
+#include <QtEndian>
|
||||
|
||||
static const int riffHeaderSize = 12; // RIFF_HEADER_SIZE from webp/format_constants.h
|
||||
|
||||
@@ -102,21 +103,23 @@ bool QWebpHandler::ensureScanned() const
|
||||
|
||||
m_scanState = ScanError;
|
||||
|
||||
- if (device()->isSequential()) {
|
||||
- qWarning() << "Sequential devices are not supported";
|
||||
+ QWebpHandler *that = const_cast<QWebpHandler *>(this);
|
||||
+ const int headerBytesNeeded = sizeof(WebPBitstreamFeatures);
|
||||
+ QByteArray header = device()->peek(headerBytesNeeded);
|
||||
+ if (header.size() < headerBytesNeeded)
|
||||
return false;
|
||||
- }
|
||||
|
||||
- qint64 oldPos = device()->pos();
|
||||
- device()->seek(0);
|
||||
-
|
||||
- QWebpHandler *that = const_cast<QWebpHandler *>(this);
|
||||
- QByteArray header = device()->peek(sizeof(WebPBitstreamFeatures));
|
||||
+ // We do no random access during decoding, just a readAll() of the whole image file. So if
|
||||
+ // if it is all available already, we can accept a sequential device. The riff header contains
|
||||
+ // the file size minus 8 bytes header
|
||||
+ qint64 byteSize = qFromLittleEndian<quint32>(header.constData() + 4);
|
||||
+ if (device()->isSequential() && device()->bytesAvailable() < byteSize + 8) {
|
||||
+ qWarning() << "QWebpHandler: Insufficient data available in sequential device";
|
||||
+ return false;
|
||||
+ }
|
||||
if (WebPGetFeatures((const uint8_t*)header.constData(), header.size(), &(that->m_features)) == VP8_STATUS_OK) {
|
||||
if (m_features.has_animation) {
|
||||
// For animation, we have to read and scan whole file to determine loop count and images count
|
||||
- device()->seek(oldPos);
|
||||
-
|
||||
if (that->ensureDemuxer()) {
|
||||
that->m_loop = WebPDemuxGetI(m_demuxer, WEBP_FF_LOOP_COUNT);
|
||||
that->m_frameCount = WebPDemuxGetI(m_demuxer, WEBP_FF_FRAME_COUNT);
|
||||
@@ -126,17 +129,13 @@ bool QWebpHandler::ensureScanned() const
|
||||
if (that->m_features.has_alpha)
|
||||
that->m_composited->fill(Qt::transparent);
|
||||
|
||||
- // We do not reset device position since we have read in all data
|
||||
m_scanState = ScanSuccess;
|
||||
- return true;
|
||||
}
|
||||
} else {
|
||||
m_scanState = ScanSuccess;
|
||||
}
|
||||
}
|
||||
|
||||
- device()->seek(oldPos);
|
||||
-
|
||||
return m_scanState == ScanSuccess;
|
||||
}
|
||||
|
||||
@@ -159,7 +158,7 @@ bool QWebpHandler::ensureDemuxer()
|
||||
|
||||
bool QWebpHandler::read(QImage *image)
|
||||
{
|
||||
- if (!ensureScanned() || device()->isSequential() || !ensureDemuxer())
|
||||
+ if (!ensureScanned() || !ensureDemuxer())
|
||||
return false;
|
||||
|
||||
QRect prevFrameRect;
|
||||
--
|
||||
2.46.0
|
||||
|
@ -0,0 +1,40 @@
|
||||
From 97ba7cda01bd474573b40f44729c0927f7181e91 Mon Sep 17 00:00:00 2001
|
||||
From: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
||||
Date: Fri, 18 Mar 2022 09:16:36 +0100
|
||||
Subject: [PATCH 2/4] Explicitly include QVarLengthArray header
|
||||
|
||||
The template is instantiated, but only forward declared after recent
|
||||
cleanup of transitive includes.
|
||||
|
||||
Pick-to: 6.3
|
||||
Change-Id: Id43dfe4dc8aa20815ff6b5f64ab307a269ce6c67
|
||||
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
||||
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
||||
(cherry picked from commit 1224337fdf898e502d3b04f9eb3975947de06fe8)
|
||||
---
|
||||
src/plugins/imageformats/tiff/qtiffhandler.cpp | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/imageformats/tiff/qtiffhandler.cpp b/src/plugins/imageformats/tiff/qtiffhandler.cpp
|
||||
index f0dfe7f..5cb0522 100644
|
||||
--- a/src/plugins/imageformats/tiff/qtiffhandler.cpp
|
||||
+++ b/src/plugins/imageformats/tiff/qtiffhandler.cpp
|
||||
@@ -38,13 +38,14 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qtiffhandler_p.h"
|
||||
-#include <qvariant.h>
|
||||
#include <qcolorspace.h>
|
||||
#include <qdebug.h>
|
||||
#include <qimage.h>
|
||||
#include <qglobal.h>
|
||||
#include <qbuffer.h>
|
||||
#include <qfiledevice.h>
|
||||
+#include <qvariant.h>
|
||||
+#include <qvarlengtharray.h>
|
||||
|
||||
extern "C" {
|
||||
#include "tiffio.h"
|
||||
--
|
||||
2.46.0
|
||||
|
@ -0,0 +1,460 @@
|
||||
From c46564956a151d3621af5bb5b774b9ffcb5b7a73 Mon Sep 17 00:00:00 2001
|
||||
From: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
||||
Date: Fri, 15 Sep 2023 08:49:39 +0200
|
||||
Subject: [PATCH 3/4] Update bundled libwebp to version 1.3.2
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
[ChangeLog][Third-Party Code] Update bundled libwebp to version 1.3.2
|
||||
|
||||
Pick-to: 6.6 6.6.0 6.5 6.5.3 6.2 5.15
|
||||
Fixes: QTBUG-117071
|
||||
Change-Id: Ida0ab9b4791a8203e6748960aeb96fb9ade6a383
|
||||
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
|
||||
(cherry picked from commit 4cfdd47d30573837cc36f6e4e747e7383e74c2a2)
|
||||
---
|
||||
src/3rdparty/libwebp/ChangeLog | 4 +
|
||||
src/3rdparty/libwebp/NEWS | 4 +
|
||||
src/3rdparty/libwebp/qt_attribution.json | 4 +-
|
||||
src/3rdparty/libwebp/src/dec/vp8i_dec.h | 2 +-
|
||||
src/3rdparty/libwebp/src/dec/vp8l_dec.c | 46 +++++----
|
||||
src/3rdparty/libwebp/src/dec/vp8li_dec.h | 2 +-
|
||||
src/3rdparty/libwebp/src/demux/demux.c | 2 +-
|
||||
src/3rdparty/libwebp/src/enc/vp8i_enc.h | 2 +-
|
||||
src/3rdparty/libwebp/src/mux/muxi.h | 2 +-
|
||||
.../libwebp/src/utils/huffman_utils.c | 97 +++++++++++++++----
|
||||
.../libwebp/src/utils/huffman_utils.h | 27 +++++-
|
||||
11 files changed, 143 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/libwebp/ChangeLog b/src/3rdparty/libwebp/ChangeLog
|
||||
index 5e85875..33ec486 100644
|
||||
--- a/src/3rdparty/libwebp/ChangeLog
|
||||
+++ b/src/3rdparty/libwebp/ChangeLog
|
||||
@@ -1,3 +1,7 @@
|
||||
+1ace578c update NEWS
|
||||
+63234c42 bump version to 1.3.2
|
||||
+2af26267 Fix OOB write in BuildHuffmanTable.
|
||||
+fd7bb21c update ChangeLog (tag: v1.3.1-rc2, tag: v1.3.1)
|
||||
e1adea50 update NEWS
|
||||
43393320 enc/*: normalize WebPEncodingSetError() calls
|
||||
287fdefe enc/*: add missing WebPEncodingSetError() calls
|
||||
diff --git a/src/3rdparty/libwebp/NEWS b/src/3rdparty/libwebp/NEWS
|
||||
index 2111d33..47f8451 100644
|
||||
--- a/src/3rdparty/libwebp/NEWS
|
||||
+++ b/src/3rdparty/libwebp/NEWS
|
||||
@@ -1,3 +1,7 @@
|
||||
+- 9/13/2023: version 1.3.2
|
||||
+ This is a binary compatible release.
|
||||
+ * security fix for lossless decoder (chromium: #1479274, CVE-2023-4863)
|
||||
+
|
||||
- 6/23/2023: version 1.3.1
|
||||
This is a binary compatible release.
|
||||
* security fixes for lossless encoder (#603, chromium: #1420107, #1455619,
|
||||
diff --git a/src/3rdparty/libwebp/qt_attribution.json b/src/3rdparty/libwebp/qt_attribution.json
|
||||
index 1b71a55..f1ddc6e 100644
|
||||
--- a/src/3rdparty/libwebp/qt_attribution.json
|
||||
+++ b/src/3rdparty/libwebp/qt_attribution.json
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
"Description": "WebP is a new image format that provides lossless and lossy compression for images on the web.",
|
||||
"Homepage": "https://developers.google.com/speed/webp/",
|
||||
- "Version": "1.3.1",
|
||||
- "DownloadLocation": "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.1.tar.gz",
|
||||
+ "Version": "1.3.2",
|
||||
+ "DownloadLocation": "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz",
|
||||
"License": "BSD 3-clause \"New\" or \"Revised\" License",
|
||||
"LicenseId": "BSD-3-Clause",
|
||||
"LicenseFile": "COPYING",
|
||||
diff --git a/src/3rdparty/libwebp/src/dec/vp8i_dec.h b/src/3rdparty/libwebp/src/dec/vp8i_dec.h
|
||||
index 1ae4ff6..7929fd7 100644
|
||||
--- a/src/3rdparty/libwebp/src/dec/vp8i_dec.h
|
||||
+++ b/src/3rdparty/libwebp/src/dec/vp8i_dec.h
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
// version numbers
|
||||
#define DEC_MAJ_VERSION 1
|
||||
#define DEC_MIN_VERSION 3
|
||||
-#define DEC_REV_VERSION 1
|
||||
+#define DEC_REV_VERSION 2
|
||||
|
||||
// YUV-cache parameters. Cache is 32-bytes wide (= one cacheline).
|
||||
// Constraints are: We need to store one 16x16 block of luma samples (y),
|
||||
diff --git a/src/3rdparty/libwebp/src/dec/vp8l_dec.c b/src/3rdparty/libwebp/src/dec/vp8l_dec.c
|
||||
index c0ea018..7995313 100644
|
||||
--- a/src/3rdparty/libwebp/src/dec/vp8l_dec.c
|
||||
+++ b/src/3rdparty/libwebp/src/dec/vp8l_dec.c
|
||||
@@ -253,11 +253,11 @@ static int ReadHuffmanCodeLengths(
|
||||
int symbol;
|
||||
int max_symbol;
|
||||
int prev_code_len = DEFAULT_CODE_LENGTH;
|
||||
- HuffmanCode table[1 << LENGTHS_TABLE_BITS];
|
||||
+ HuffmanTables tables;
|
||||
|
||||
- if (!VP8LBuildHuffmanTable(table, LENGTHS_TABLE_BITS,
|
||||
- code_length_code_lengths,
|
||||
- NUM_CODE_LENGTH_CODES)) {
|
||||
+ if (!VP8LHuffmanTablesAllocate(1 << LENGTHS_TABLE_BITS, &tables) ||
|
||||
+ !VP8LBuildHuffmanTable(&tables, LENGTHS_TABLE_BITS,
|
||||
+ code_length_code_lengths, NUM_CODE_LENGTH_CODES)) {
|
||||
goto End;
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ static int ReadHuffmanCodeLengths(
|
||||
int code_len;
|
||||
if (max_symbol-- == 0) break;
|
||||
VP8LFillBitWindow(br);
|
||||
- p = &table[VP8LPrefetchBits(br) & LENGTHS_TABLE_MASK];
|
||||
+ p = &tables.curr_segment->start[VP8LPrefetchBits(br) & LENGTHS_TABLE_MASK];
|
||||
VP8LSetBitPos(br, br->bit_pos_ + p->bits);
|
||||
code_len = p->value;
|
||||
if (code_len < kCodeLengthLiterals) {
|
||||
@@ -300,6 +300,7 @@ static int ReadHuffmanCodeLengths(
|
||||
ok = 1;
|
||||
|
||||
End:
|
||||
+ VP8LHuffmanTablesDeallocate(&tables);
|
||||
if (!ok) dec->status_ = VP8_STATUS_BITSTREAM_ERROR;
|
||||
return ok;
|
||||
}
|
||||
@@ -307,7 +308,8 @@ static int ReadHuffmanCodeLengths(
|
||||
// 'code_lengths' is pre-allocated temporary buffer, used for creating Huffman
|
||||
// tree.
|
||||
static int ReadHuffmanCode(int alphabet_size, VP8LDecoder* const dec,
|
||||
- int* const code_lengths, HuffmanCode* const table) {
|
||||
+ int* const code_lengths,
|
||||
+ HuffmanTables* const table) {
|
||||
int ok = 0;
|
||||
int size = 0;
|
||||
VP8LBitReader* const br = &dec->br_;
|
||||
@@ -362,8 +364,7 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
VP8LMetadata* const hdr = &dec->hdr_;
|
||||
uint32_t* huffman_image = NULL;
|
||||
HTreeGroup* htree_groups = NULL;
|
||||
- HuffmanCode* huffman_tables = NULL;
|
||||
- HuffmanCode* huffman_table = NULL;
|
||||
+ HuffmanTables* huffman_tables = &hdr->huffman_tables_;
|
||||
int num_htree_groups = 1;
|
||||
int num_htree_groups_max = 1;
|
||||
int max_alphabet_size = 0;
|
||||
@@ -372,6 +373,10 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
int* mapping = NULL;
|
||||
int ok = 0;
|
||||
|
||||
+ // Check the table has been 0 initialized (through InitMetadata).
|
||||
+ assert(huffman_tables->root.start == NULL);
|
||||
+ assert(huffman_tables->curr_segment == NULL);
|
||||
+
|
||||
if (allow_recursion && VP8LReadBits(br, 1)) {
|
||||
// use meta Huffman codes.
|
||||
const int huffman_precision = VP8LReadBits(br, 3) + 2;
|
||||
@@ -434,16 +439,15 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
|
||||
code_lengths = (int*)WebPSafeCalloc((uint64_t)max_alphabet_size,
|
||||
sizeof(*code_lengths));
|
||||
- huffman_tables = (HuffmanCode*)WebPSafeMalloc(num_htree_groups * table_size,
|
||||
- sizeof(*huffman_tables));
|
||||
htree_groups = VP8LHtreeGroupsNew(num_htree_groups);
|
||||
|
||||
- if (htree_groups == NULL || code_lengths == NULL || huffman_tables == NULL) {
|
||||
+ if (htree_groups == NULL || code_lengths == NULL ||
|
||||
+ !VP8LHuffmanTablesAllocate(num_htree_groups * table_size,
|
||||
+ huffman_tables)) {
|
||||
dec->status_ = VP8_STATUS_OUT_OF_MEMORY;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
- huffman_table = huffman_tables;
|
||||
for (i = 0; i < num_htree_groups_max; ++i) {
|
||||
// If the index "i" is unused in the Huffman image, just make sure the
|
||||
// coefficients are valid but do not store them.
|
||||
@@ -468,19 +472,20 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
int max_bits = 0;
|
||||
for (j = 0; j < HUFFMAN_CODES_PER_META_CODE; ++j) {
|
||||
int alphabet_size = kAlphabetSize[j];
|
||||
- htrees[j] = huffman_table;
|
||||
if (j == 0 && color_cache_bits > 0) {
|
||||
alphabet_size += (1 << color_cache_bits);
|
||||
}
|
||||
- size = ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_table);
|
||||
+ size =
|
||||
+ ReadHuffmanCode(alphabet_size, dec, code_lengths, huffman_tables);
|
||||
+ htrees[j] = huffman_tables->curr_segment->curr_table;
|
||||
if (size == 0) {
|
||||
goto Error;
|
||||
}
|
||||
if (is_trivial_literal && kLiteralMap[j] == 1) {
|
||||
- is_trivial_literal = (huffman_table->bits == 0);
|
||||
+ is_trivial_literal = (htrees[j]->bits == 0);
|
||||
}
|
||||
- total_size += huffman_table->bits;
|
||||
- huffman_table += size;
|
||||
+ total_size += htrees[j]->bits;
|
||||
+ huffman_tables->curr_segment->curr_table += size;
|
||||
if (j <= ALPHA) {
|
||||
int local_max_bits = code_lengths[0];
|
||||
int k;
|
||||
@@ -515,14 +520,13 @@ static int ReadHuffmanCodes(VP8LDecoder* const dec, int xsize, int ysize,
|
||||
hdr->huffman_image_ = huffman_image;
|
||||
hdr->num_htree_groups_ = num_htree_groups;
|
||||
hdr->htree_groups_ = htree_groups;
|
||||
- hdr->huffman_tables_ = huffman_tables;
|
||||
|
||||
Error:
|
||||
WebPSafeFree(code_lengths);
|
||||
WebPSafeFree(mapping);
|
||||
if (!ok) {
|
||||
WebPSafeFree(huffman_image);
|
||||
- WebPSafeFree(huffman_tables);
|
||||
+ VP8LHuffmanTablesDeallocate(huffman_tables);
|
||||
VP8LHtreeGroupsFree(htree_groups);
|
||||
}
|
||||
return ok;
|
||||
@@ -1358,7 +1362,7 @@ static void ClearMetadata(VP8LMetadata* const hdr) {
|
||||
assert(hdr != NULL);
|
||||
|
||||
WebPSafeFree(hdr->huffman_image_);
|
||||
- WebPSafeFree(hdr->huffman_tables_);
|
||||
+ VP8LHuffmanTablesDeallocate(&hdr->huffman_tables_);
|
||||
VP8LHtreeGroupsFree(hdr->htree_groups_);
|
||||
VP8LColorCacheClear(&hdr->color_cache_);
|
||||
VP8LColorCacheClear(&hdr->saved_color_cache_);
|
||||
@@ -1673,7 +1677,7 @@ int VP8LDecodeImage(VP8LDecoder* const dec) {
|
||||
|
||||
if (dec == NULL) return 0;
|
||||
|
||||
- assert(dec->hdr_.huffman_tables_ != NULL);
|
||||
+ assert(dec->hdr_.huffman_tables_.root.start != NULL);
|
||||
assert(dec->hdr_.htree_groups_ != NULL);
|
||||
assert(dec->hdr_.num_htree_groups_ > 0);
|
||||
|
||||
diff --git a/src/3rdparty/libwebp/src/dec/vp8li_dec.h b/src/3rdparty/libwebp/src/dec/vp8li_dec.h
|
||||
index 72b2e86..32540a4 100644
|
||||
--- a/src/3rdparty/libwebp/src/dec/vp8li_dec.h
|
||||
+++ b/src/3rdparty/libwebp/src/dec/vp8li_dec.h
|
||||
@@ -51,7 +51,7 @@ typedef struct {
|
||||
uint32_t* huffman_image_;
|
||||
int num_htree_groups_;
|
||||
HTreeGroup* htree_groups_;
|
||||
- HuffmanCode* huffman_tables_;
|
||||
+ HuffmanTables huffman_tables_;
|
||||
} VP8LMetadata;
|
||||
|
||||
typedef struct VP8LDecoder VP8LDecoder;
|
||||
diff --git a/src/3rdparty/libwebp/src/demux/demux.c b/src/3rdparty/libwebp/src/demux/demux.c
|
||||
index fd45a25..4b0d3f5 100644
|
||||
--- a/src/3rdparty/libwebp/src/demux/demux.c
|
||||
+++ b/src/3rdparty/libwebp/src/demux/demux.c
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
#define DMUX_MAJ_VERSION 1
|
||||
#define DMUX_MIN_VERSION 3
|
||||
-#define DMUX_REV_VERSION 1
|
||||
+#define DMUX_REV_VERSION 2
|
||||
|
||||
typedef struct {
|
||||
size_t start_; // start location of the data
|
||||
diff --git a/src/3rdparty/libwebp/src/enc/vp8i_enc.h b/src/3rdparty/libwebp/src/enc/vp8i_enc.h
|
||||
index 19d9a6e..0864fbf 100644
|
||||
--- a/src/3rdparty/libwebp/src/enc/vp8i_enc.h
|
||||
+++ b/src/3rdparty/libwebp/src/enc/vp8i_enc.h
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
// version numbers
|
||||
#define ENC_MAJ_VERSION 1
|
||||
#define ENC_MIN_VERSION 3
|
||||
-#define ENC_REV_VERSION 1
|
||||
+#define ENC_REV_VERSION 2
|
||||
|
||||
enum { MAX_LF_LEVELS = 64, // Maximum loop filter level
|
||||
MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost
|
||||
diff --git a/src/3rdparty/libwebp/src/mux/muxi.h b/src/3rdparty/libwebp/src/mux/muxi.h
|
||||
index fc44d6f..afc5954 100644
|
||||
--- a/src/3rdparty/libwebp/src/mux/muxi.h
|
||||
+++ b/src/3rdparty/libwebp/src/mux/muxi.h
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
|
||||
#define MUX_MAJ_VERSION 1
|
||||
#define MUX_MIN_VERSION 3
|
||||
-#define MUX_REV_VERSION 1
|
||||
+#define MUX_REV_VERSION 2
|
||||
|
||||
// Chunk object.
|
||||
typedef struct WebPChunk WebPChunk;
|
||||
diff --git a/src/3rdparty/libwebp/src/utils/huffman_utils.c b/src/3rdparty/libwebp/src/utils/huffman_utils.c
|
||||
index 90c2fbf..cf73abd 100644
|
||||
--- a/src/3rdparty/libwebp/src/utils/huffman_utils.c
|
||||
+++ b/src/3rdparty/libwebp/src/utils/huffman_utils.c
|
||||
@@ -177,21 +177,24 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
||||
if (num_open < 0) {
|
||||
return 0;
|
||||
}
|
||||
- if (root_table == NULL) continue;
|
||||
for (; count[len] > 0; --count[len]) {
|
||||
HuffmanCode code;
|
||||
if ((key & mask) != low) {
|
||||
- table += table_size;
|
||||
+ if (root_table != NULL) table += table_size;
|
||||
table_bits = NextTableBitSize(count, len, root_bits);
|
||||
table_size = 1 << table_bits;
|
||||
total_size += table_size;
|
||||
low = key & mask;
|
||||
- root_table[low].bits = (uint8_t)(table_bits + root_bits);
|
||||
- root_table[low].value = (uint16_t)((table - root_table) - low);
|
||||
+ if (root_table != NULL) {
|
||||
+ root_table[low].bits = (uint8_t)(table_bits + root_bits);
|
||||
+ root_table[low].value = (uint16_t)((table - root_table) - low);
|
||||
+ }
|
||||
+ }
|
||||
+ if (root_table != NULL) {
|
||||
+ code.bits = (uint8_t)(len - root_bits);
|
||||
+ code.value = (uint16_t)sorted[symbol++];
|
||||
+ ReplicateValue(&table[key >> root_bits], step, table_size, code);
|
||||
}
|
||||
- code.bits = (uint8_t)(len - root_bits);
|
||||
- code.value = (uint16_t)sorted[symbol++];
|
||||
- ReplicateValue(&table[key >> root_bits], step, table_size, code);
|
||||
key = GetNextKey(key, len);
|
||||
}
|
||||
}
|
||||
@@ -211,25 +214,83 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
||||
((1 << MAX_CACHE_BITS) + NUM_LITERAL_CODES + NUM_LENGTH_CODES)
|
||||
// Cut-off value for switching between heap and stack allocation.
|
||||
#define SORTED_SIZE_CUTOFF 512
|
||||
-int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
||||
+int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int root_bits,
|
||||
const int code_lengths[], int code_lengths_size) {
|
||||
- int total_size;
|
||||
+ const int total_size =
|
||||
+ BuildHuffmanTable(NULL, root_bits, code_lengths, code_lengths_size, NULL);
|
||||
assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE);
|
||||
- if (root_table == NULL) {
|
||||
- total_size = BuildHuffmanTable(NULL, root_bits,
|
||||
- code_lengths, code_lengths_size, NULL);
|
||||
- } else if (code_lengths_size <= SORTED_SIZE_CUTOFF) {
|
||||
+ if (total_size == 0 || root_table == NULL) return total_size;
|
||||
+
|
||||
+ if (root_table->curr_segment->curr_table + total_size >=
|
||||
+ root_table->curr_segment->start + root_table->curr_segment->size) {
|
||||
+ // If 'root_table' does not have enough memory, allocate a new segment.
|
||||
+ // The available part of root_table->curr_segment is left unused because we
|
||||
+ // need a contiguous buffer.
|
||||
+ const int segment_size = root_table->curr_segment->size;
|
||||
+ struct HuffmanTablesSegment* next =
|
||||
+ (HuffmanTablesSegment*)WebPSafeMalloc(1, sizeof(*next));
|
||||
+ if (next == NULL) return 0;
|
||||
+ // Fill the new segment.
|
||||
+ // We need at least 'total_size' but if that value is small, it is better to
|
||||
+ // allocate a big chunk to prevent more allocations later. 'segment_size' is
|
||||
+ // therefore chosen (any other arbitrary value could be chosen).
|
||||
+ next->size = total_size > segment_size ? total_size : segment_size;
|
||||
+ next->start =
|
||||
+ (HuffmanCode*)WebPSafeMalloc(next->size, sizeof(*next->start));
|
||||
+ if (next->start == NULL) {
|
||||
+ WebPSafeFree(next);
|
||||
+ return 0;
|
||||
+ }
|
||||
+ next->curr_table = next->start;
|
||||
+ next->next = NULL;
|
||||
+ // Point to the new segment.
|
||||
+ root_table->curr_segment->next = next;
|
||||
+ root_table->curr_segment = next;
|
||||
+ }
|
||||
+ if (code_lengths_size <= SORTED_SIZE_CUTOFF) {
|
||||
// use local stack-allocated array.
|
||||
uint16_t sorted[SORTED_SIZE_CUTOFF];
|
||||
- total_size = BuildHuffmanTable(root_table, root_bits,
|
||||
- code_lengths, code_lengths_size, sorted);
|
||||
- } else { // rare case. Use heap allocation.
|
||||
+ BuildHuffmanTable(root_table->curr_segment->curr_table, root_bits,
|
||||
+ code_lengths, code_lengths_size, sorted);
|
||||
+ } else { // rare case. Use heap allocation.
|
||||
uint16_t* const sorted =
|
||||
(uint16_t*)WebPSafeMalloc(code_lengths_size, sizeof(*sorted));
|
||||
if (sorted == NULL) return 0;
|
||||
- total_size = BuildHuffmanTable(root_table, root_bits,
|
||||
- code_lengths, code_lengths_size, sorted);
|
||||
+ BuildHuffmanTable(root_table->curr_segment->curr_table, root_bits,
|
||||
+ code_lengths, code_lengths_size, sorted);
|
||||
WebPSafeFree(sorted);
|
||||
}
|
||||
return total_size;
|
||||
}
|
||||
+
|
||||
+int VP8LHuffmanTablesAllocate(int size, HuffmanTables* huffman_tables) {
|
||||
+ // Have 'segment' point to the first segment for now, 'root'.
|
||||
+ HuffmanTablesSegment* const root = &huffman_tables->root;
|
||||
+ huffman_tables->curr_segment = root;
|
||||
+ // Allocate root.
|
||||
+ root->start = (HuffmanCode*)WebPSafeMalloc(size, sizeof(*root->start));
|
||||
+ if (root->start == NULL) return 0;
|
||||
+ root->curr_table = root->start;
|
||||
+ root->next = NULL;
|
||||
+ root->size = size;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables) {
|
||||
+ HuffmanTablesSegment *current, *next;
|
||||
+ if (huffman_tables == NULL) return;
|
||||
+ // Free the root node.
|
||||
+ current = &huffman_tables->root;
|
||||
+ next = current->next;
|
||||
+ WebPSafeFree(current->start);
|
||||
+ current->start = NULL;
|
||||
+ current->next = NULL;
|
||||
+ current = next;
|
||||
+ // Free the following nodes.
|
||||
+ while (current != NULL) {
|
||||
+ next = current->next;
|
||||
+ WebPSafeFree(current->start);
|
||||
+ WebPSafeFree(current);
|
||||
+ current = next;
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/3rdparty/libwebp/src/utils/huffman_utils.h b/src/3rdparty/libwebp/src/utils/huffman_utils.h
|
||||
index 13b7ad1..98415c5 100644
|
||||
--- a/src/3rdparty/libwebp/src/utils/huffman_utils.h
|
||||
+++ b/src/3rdparty/libwebp/src/utils/huffman_utils.h
|
||||
@@ -43,6 +43,29 @@ typedef struct {
|
||||
// or non-literal symbol otherwise
|
||||
} HuffmanCode32;
|
||||
|
||||
+// Contiguous memory segment of HuffmanCodes.
|
||||
+typedef struct HuffmanTablesSegment {
|
||||
+ HuffmanCode* start;
|
||||
+ // Pointer to where we are writing into the segment. Starts at 'start' and
|
||||
+ // cannot go beyond 'start' + 'size'.
|
||||
+ HuffmanCode* curr_table;
|
||||
+ // Pointer to the next segment in the chain.
|
||||
+ struct HuffmanTablesSegment* next;
|
||||
+ int size;
|
||||
+} HuffmanTablesSegment;
|
||||
+
|
||||
+// Chained memory segments of HuffmanCodes.
|
||||
+typedef struct HuffmanTables {
|
||||
+ HuffmanTablesSegment root;
|
||||
+ // Currently processed segment. At first, this is 'root'.
|
||||
+ HuffmanTablesSegment* curr_segment;
|
||||
+} HuffmanTables;
|
||||
+
|
||||
+// Allocates a HuffmanTables with 'size' contiguous HuffmanCodes. Returns 0 on
|
||||
+// memory allocation error, 1 otherwise.
|
||||
+int VP8LHuffmanTablesAllocate(int size, HuffmanTables* huffman_tables);
|
||||
+void VP8LHuffmanTablesDeallocate(HuffmanTables* const huffman_tables);
|
||||
+
|
||||
#define HUFFMAN_PACKED_BITS 6
|
||||
#define HUFFMAN_PACKED_TABLE_SIZE (1u << HUFFMAN_PACKED_BITS)
|
||||
|
||||
@@ -78,9 +101,7 @@ void VP8LHtreeGroupsFree(HTreeGroup* const htree_groups);
|
||||
// the huffman table.
|
||||
// Returns built table size or 0 in case of error (invalid tree or
|
||||
// memory error).
|
||||
-// If root_table is NULL, it returns 0 if a lookup cannot be built, something
|
||||
-// > 0 otherwise (but not the table size).
|
||||
-int VP8LBuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
||||
+int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int root_bits,
|
||||
const int code_lengths[], int code_lengths_size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
--
|
||||
2.46.0
|
||||
|
@ -0,0 +1,939 @@
|
||||
From 9f658c2093e81d1dc3333e594cc1aa4b0990e221 Mon Sep 17 00:00:00 2001
|
||||
From: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
||||
Date: Fri, 15 Sep 2023 18:22:32 +0200
|
||||
Subject: [PATCH 4/4] Update bundled libtiff to version 4.6.0
|
||||
|
||||
[ChangeLog][Third-Party Code] Bundled libtiff was updated to version 4.6.0
|
||||
|
||||
Pick-to: 6.6 6.5 6.2 5.15
|
||||
Change-Id: Ia6c5df57d6759c1b1544f1777266cdb703f80faa
|
||||
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
||||
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
|
||||
(cherry picked from commit 4feed665065ac10281d74eaaf3dbcdaef2bbdd0f)
|
||||
---
|
||||
src/3rdparty/libtiff/ChangeLog | 366 ++++++++++++++++++
|
||||
src/3rdparty/libtiff/RELEASE-DATE | 2 +-
|
||||
src/3rdparty/libtiff/VERSION | 2 +-
|
||||
src/3rdparty/libtiff/libtiff/tif_config.h | 33 --
|
||||
.../libtiff/libtiff/tif_config.h.cmake.in | 29 +-
|
||||
src/3rdparty/libtiff/libtiff/tif_config.h.in | 27 --
|
||||
src/3rdparty/libtiff/libtiff/tif_dirread.c | 2 +-
|
||||
src/3rdparty/libtiff/libtiff/tif_dirwrite.c | 33 +-
|
||||
src/3rdparty/libtiff/libtiff/tif_webp.c | 87 ++++-
|
||||
src/3rdparty/libtiff/libtiff/tiff.h | 3 +-
|
||||
src/3rdparty/libtiff/libtiff/tiffio.h | 2 +-
|
||||
src/3rdparty/libtiff/libtiff/tiffvers.h | 14 +-
|
||||
src/3rdparty/libtiff/qt_attribution.json | 4 +-
|
||||
13 files changed, 489 insertions(+), 115 deletions(-)
|
||||
|
||||
diff --git a/src/3rdparty/libtiff/ChangeLog b/src/3rdparty/libtiff/ChangeLog
|
||||
index 2124816..87b5f12 100644
|
||||
--- a/src/3rdparty/libtiff/ChangeLog
|
||||
+++ b/src/3rdparty/libtiff/ChangeLog
|
||||
@@ -1,3 +1,369 @@
|
||||
+2023-09-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ libtiff v4.6.0 released
|
||||
+
|
||||
+2023-09-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_600' into 'master'
|
||||
+ CMake: fix build with -Dstrip-chopping=off (fixes #600)
|
||||
+
|
||||
+ See merge request libtiff/libtiff!527
|
||||
+
|
||||
+2023-09-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'georgthegreat-master-patch-87447' into 'master'
|
||||
+ Fix using __attribute__ libtiff with clang-for-windows
|
||||
+
|
||||
+ See merge request libtiff/libtiff!525
|
||||
+
|
||||
+2023-09-05 Yuriy Chernyshov <georgthegreat@gmail.com>
|
||||
+
|
||||
+ Fix using __attribute__ libtiff with clang-for-windows.
|
||||
+
|
||||
+2023-09-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'manpage_TIFFField_docu_update' into 'master'
|
||||
+ manpages: TiffField functions documentation updated with return behaviour for...
|
||||
+
|
||||
+ See merge request libtiff/libtiff!526
|
||||
+
|
||||
+2023-09-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ CMake: fix build with -Dstrip-chopping=off (fixes #600)
|
||||
+
|
||||
+2023-09-03 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'consistently_update_TIFF-version_from_configure-ac' into 'master'
|
||||
+ Update CMake and autoconf scripts to consistently update LibTIFF version...
|
||||
+
|
||||
+ See merge request libtiff/libtiff!456
|
||||
+
|
||||
+2023-09-03 Su Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Update CMake and autoconf scripts to consistently update LibTIFF version defines and references in various files when version definition in configure.ac has been changed.
|
||||
+ - Move in tiffvers.h from .\libtiff source directory to .\libtiff build directory.
|
||||
+ - Remove unused version information from tif_config.h
|
||||
+ - With every CMake build the version defines (e.g. 4.5.1) within tiffvers.h are consistently updated from configure.ac. The version release-date is taken from file RELEASE-DATE.
|
||||
+ - The files VERSION and RELEASE-DATE are only updated with a special CMake target build: cmake --build . --target tiff_release.
|
||||
+
|
||||
+ - For autotools, version information is updated from configure.ac with ./autogen.sh. LIBTIFF_RELEASE_DATE is taken form file RELEASE-DATE.
|
||||
+ - ./configure generates tiffvers.h with the cached version information and LIBTIFF_RELEASE_DATE.
|
||||
+ - "make release" updates tiffvers.h and VERSION file with cached version info and RELEASE-DATE file and tiffves.h with the current date.
|
||||
+
|
||||
+2023-08-28 Su_Laus <sulau@freenet.de>
|
||||
+
|
||||
+ manpages: TiffField functions documentation updated with return behaviour for not defined tags and determination of write-/read-count size.
|
||||
+
|
||||
+2023-08-22 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'change_long_to_int32_t_in_two_test_apps' into 'master'
|
||||
+ Change "long" to "int32_t" in two test apps, because can be either int32_t or...
|
||||
+
|
||||
+ See merge request libtiff/libtiff!524
|
||||
+
|
||||
+2023-08-21 Su_Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Change "long" to "int32_t" in two test apps, because can be either int32_t or int64_t, depending on compiler and system.
|
||||
+
|
||||
+2023-08-16 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'CI_CMake_static_build' into 'master'
|
||||
+ Add static build for CI/CD to run testcases which need private interface functions.
|
||||
+
|
||||
+ See merge request libtiff/libtiff!521
|
||||
+
|
||||
+2023-08-16 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_#597_tiffset_different_signedness' into 'master'
|
||||
+ tiffset fix #597: warning: comparison of integer expressions of different signedness.
|
||||
+
|
||||
+ Closes #597
|
||||
+
|
||||
+ See merge request libtiff/libtiff!523
|
||||
+
|
||||
+2023-08-16 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'tiffcp_remove_i_option' into 'master'
|
||||
+ tiffcp: remove -i option (ignore errors)
|
||||
+
|
||||
+ See merge request libtiff/libtiff!522
|
||||
+
|
||||
+2023-08-16 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'move_tools_to_unsupported_a_archive' into 'master'
|
||||
+ Move most TIFF tools to archive and keep some as unsupported (see #580).
|
||||
+
|
||||
+ See merge request libtiff/libtiff!520
|
||||
+
|
||||
+2023-08-16 Su Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Move most TIFF tools to archive and keep some as unsupported (see #580).
|
||||
+
|
||||
+2023-08-12 Su_Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Add static build for CI/CD to run testcases which need private interface functions.
|
||||
+
|
||||
+ tiffset fix #597: warning: comparison of integer expressions of different signedness.
|
||||
+
|
||||
+ Remove -i option (ignore errors) from tiffcp, because almost all fuzzer issues were consequential errors from ignored errors because of the "-i" option.
|
||||
+
|
||||
+2023-08-11 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_585_test_write_read_tags_autoconf' into 'master'
|
||||
+ Add missing test_write_read_tags.c and test_transferfunction_write_read.c in...
|
||||
+
|
||||
+ Closes #585
|
||||
+
|
||||
+ See merge request libtiff/libtiff!519
|
||||
+
|
||||
+2023-07-24 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Fix copy paste error.
|
||||
+
|
||||
+2023-07-23 Su_Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Add missing test_write_read_tags.c and test_transferfunction_write_read.c in tarball (fixes #585) and correct „long“ issue.
|
||||
+ Don't use "long" because can be int32_t or int64_t, depending on compiler and system.
|
||||
+
|
||||
+2023-07-20 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'clang-format-tools' into 'master'
|
||||
+ Automatically format with clang-format
|
||||
+
|
||||
+ See merge request libtiff/libtiff!518
|
||||
+
|
||||
+2023-07-20 Timothy Lyanguzov <timothy.lyanguzov@sap.com>
|
||||
+
|
||||
+ Automatically format with clang-format.
|
||||
+
|
||||
+2023-07-20 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_589' into 'master'
|
||||
+ TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and...
|
||||
+
|
||||
+ Closes #589
|
||||
+
|
||||
+ See merge request libtiff/libtiff!514
|
||||
+
|
||||
+2023-07-20 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ TiffConfig.cmake.in: set TIFF_INCLUDE_DIR, TIFF_INCLUDE_DIRS and...
|
||||
+
|
||||
+2023-07-19 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'master-patch-6fc6' into 'master'
|
||||
+ raw2tiff: fix integer overflow and bypass of the check (fixes #592)
|
||||
+
|
||||
+ See merge request libtiff/libtiff!516
|
||||
+
|
||||
+2023-07-19 Arie Haenel <arie.haenel@jct.ac.il>
|
||||
+
|
||||
+ raw2tiff: fix integer overflow and bypass of the check (fixes #592)
|
||||
+
|
||||
+2023-07-19 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'master-patch-05a4' into 'master'
|
||||
+ tiffcp: fix memory corruption (overflow) on hostile images (fixes #591)
|
||||
+
|
||||
+ See merge request libtiff/libtiff!515
|
||||
+
|
||||
+2023-07-19 Arie Haenel <arie.haenel@jct.ac.il>
|
||||
+
|
||||
+ tiffcp: fix memory corruption (overflow) on hostile images (fixes #591)
|
||||
+
|
||||
+2023-07-17 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix-numtrunc' into 'master'
|
||||
+ fix numtrunc at tiff_dirread.c
|
||||
+
|
||||
+ See merge request libtiff/libtiff!512
|
||||
+
|
||||
+2023-07-17 headshog <craaaaaachind@gmail.com>
|
||||
+
|
||||
+ TIFFReadDirectoryCheckOrder: avoid integer overflow.
|
||||
+ When it occurs, it should be harmless in practice though
|
||||
+
|
||||
+2023-07-17 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'webp_lossless_exact' into 'master'
|
||||
+ WebP codec: turn exact mode when creating lossless files to avoid altering...
|
||||
+
|
||||
+ See merge request libtiff/libtiff!511
|
||||
+
|
||||
+2023-07-11 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ WebP codec: turn exact mode when creating lossless files to avoid altering R,G,B values in areas where alpha=0
|
||||
+ Fixes https://github.com/OSGeo/gdal/issues/8038
|
||||
+
|
||||
+2023-07-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'webp_reg_fix' into 'master'
|
||||
+ WebP decoder: fix error when reading a 3-band blob in a RGBA image
|
||||
+
|
||||
+ See merge request libtiff/libtiff!510
|
||||
+
|
||||
+2023-07-05 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ WebP decoder: fix error when reading a 3-band blob in a RGBA image.
|
||||
+ Fixes regression of 350ff161c8a61b6483a1e4689e09cd47dd0dd5f9 (master only)
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'appveyor_fix' into 'master'
|
||||
+ .appveyor.yml: workaround build error
|
||||
+
|
||||
+ See merge request libtiff/libtiff!509
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ .appveyor.yml: workaround build error.
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'tif_webp_warning_fixes' into 'master'
|
||||
+ tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit)
|
||||
+
|
||||
+ See merge request libtiff/libtiff!508
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ tif_webp.c: fix signed vs unsigned comparison warnings (fix previous commit)
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_TransferFunction_writing' into 'master'
|
||||
+ Fix TransferFunction writing of only two transfer functions.
|
||||
+
|
||||
+ See merge request libtiff/libtiff!502
|
||||
+
|
||||
+2023-06-26 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_581_582' into 'master'
|
||||
+ WebP decoder: validate WebP blob width, height, band count against TIFF parameters
|
||||
+
|
||||
+ Closes #582 et #581
|
||||
+
|
||||
+ See merge request libtiff/libtiff!507
|
||||
+
|
||||
+2023-06-19 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'warning_cmake_config_file' into 'master'
|
||||
+ v4.5.1 release note: add warning about CMake config file being preview
|
||||
+
|
||||
+ See merge request libtiff/libtiff!506
|
||||
+
|
||||
+2023-06-17 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ WebP decoder: validate WebP blob width, height, band count against TIFF parameters
|
||||
+ to avoid use of uninitialized variable, or decoding corrupted content
|
||||
+ without explicit error
|
||||
+
|
||||
+ Fixes #581, fixes #582
|
||||
+
|
||||
+2023-06-15 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ v4.5.1 release note: add warning about CMake config file being preview.
|
||||
+
|
||||
+2023-06-14 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'HOWTO-RELEASE-gitlab-release' into 'master'
|
||||
+ HOWTO-RELEASE: mention creating a gitlab release
|
||||
+
|
||||
+ See merge request libtiff/libtiff!505
|
||||
+
|
||||
+2023-06-14 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ HOWTO-RELEASE: mention creating a gitlab release.
|
||||
+
|
||||
+2023-06-10 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'TIFFOpenWExt_O_RDWR' into 'master'
|
||||
+ TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux
|
||||
+
|
||||
+ See merge request libtiff/libtiff!504
|
||||
+
|
||||
+2023-06-10 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ TIFFOpenWExt(): mode r+ in the Windows implementation adjusted to that of Linux
|
||||
+
|
||||
+2023-06-10 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_ossfuzz_59751' into 'master'
|
||||
+ TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL
|
||||
+
|
||||
+ See merge request libtiff/libtiff!503
|
||||
+
|
||||
+2023-06-10 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ TIFFReadDirectory(): fix crash when reading tag TIFFTAG_EP_BATTERYLEVEL.
|
||||
+ Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=59751
|
||||
+
|
||||
+ In 738e0409 (refs #575), we disabled DNG / EP tags, but there was a
|
||||
+ special proessing for TIFFTAG_EP_BATTERYLEVEL that must be disabled
|
||||
+ since the tag is no longer defined.
|
||||
+
|
||||
+2023-06-09 Su_Laus <sulau@freenet.de>
|
||||
+
|
||||
+ Fix TransferFunction writing of only two transfer functions. The TIFFWriteDirectoryTagTransferfunction() function writes in some cases only two transfer functions, although only exactly one or exactly three transfer functions are allowed. This then leads to an error when reading. --> TIFFReadDirectory: Warning, Incorrect count for "TransferFunction"; tag ignored.
|
||||
+ This MR corrects the behaviour of TIFFWriteDirectoryTagTransferfunction() accordingly. Furthermore, a possible buffer overflow is avoided.
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_win_build' into 'master'
|
||||
+ Fix Windows build
|
||||
+
|
||||
+ Closes #578
|
||||
+
|
||||
+ See merge request libtiff/libtiff!501
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ cmake/PkgConfig.cmake: avoid CMake error when prefix or suffix is empty.
|
||||
+
|
||||
+ Add tif_win32_versioninfo.rc and tif_tools_versioninfo.rc to EXTRA_DIST.
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_coverity_build' into 'master'
|
||||
+ build/gitlab-ci: fix coverity_build()
|
||||
+
|
||||
+ See merge request libtiff/libtiff!499
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ build/gitlab-ci: fix coverity_build()
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'v4.5.1rc1_preparation' into 'master'
|
||||
+ Prepare release 4.5.1
|
||||
+
|
||||
+ See merge request libtiff/libtiff!498
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Prepare for v4.5.1 release.
|
||||
+
|
||||
+ Merge remote-tracking branch 'sulaus/Rel_4.5.1_preparation'
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'disable_dng_tags' into 'master'
|
||||
+ tif_dirinfo.c: disable DNG 1.2->1.6 tags
|
||||
+
|
||||
+ Closes #575
|
||||
+
|
||||
+ See merge request libtiff/libtiff!497
|
||||
+
|
||||
+2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
+
|
||||
+ Merge branch 'fix_577' into 'master'
|
||||
+ CMake related fixes
|
||||
+
|
||||
+ Closes #577
|
||||
+
|
||||
+ See merge request libtiff/libtiff!496
|
||||
+
|
||||
2023-06-09 Even Rouault <even.rouault@spatialys.com>
|
||||
|
||||
libtiff v4.5.1 released
|
||||
diff --git a/src/3rdparty/libtiff/RELEASE-DATE b/src/3rdparty/libtiff/RELEASE-DATE
|
||||
index a4ca097..68d9434 100644
|
||||
--- a/src/3rdparty/libtiff/RELEASE-DATE
|
||||
+++ b/src/3rdparty/libtiff/RELEASE-DATE
|
||||
@@ -1 +1 @@
|
||||
-20230609
|
||||
+20230908
|
||||
diff --git a/src/3rdparty/libtiff/VERSION b/src/3rdparty/libtiff/VERSION
|
||||
index 4404a17..6016e8a 100644
|
||||
--- a/src/3rdparty/libtiff/VERSION
|
||||
+++ b/src/3rdparty/libtiff/VERSION
|
||||
@@ -1 +1 @@
|
||||
-4.5.1
|
||||
+4.6.0
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h
|
||||
index 95ccbd3..7922155 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_config.h
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h
|
||||
@@ -4,10 +4,6 @@
|
||||
|
||||
#include "tiffconf.h"
|
||||
|
||||
-#if defined(Q_OS_WINCE)
|
||||
-#include <qfunctions_wince.h>
|
||||
-#endif
|
||||
-
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
@@ -36,9 +32,7 @@
|
||||
#define HAVE_DECL_OPTARG 0
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
-#if !defined(Q_OS_WINCE)
|
||||
#define HAVE_FCNTL_H 1
|
||||
-#endif
|
||||
|
||||
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
||||
/* #undef HAVE_FSEEKO */
|
||||
@@ -46,18 +40,6 @@
|
||||
/* Define to 1 if you have the `getopt' function. */
|
||||
/* #undef HAVE_GETOPT */
|
||||
|
||||
-/* Define to 1 if you have the <GLUT/glut.h> header file. */
|
||||
-/* #undef HAVE_GLUT_GLUT_H */
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glut.h> header file. */
|
||||
-/* #undef HAVE_GL_GLUT_H */
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glu.h> header file. */
|
||||
-/* #undef HAVE_GL_GLU_H */
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/gl.h> header file. */
|
||||
-/* #undef HAVE_GL_GL_H */
|
||||
-
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
/* #undef HAVE_IO_H */
|
||||
|
||||
@@ -67,12 +49,6 @@
|
||||
/* Define to 1 if you have the `mmap' function. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
-/* Define to 1 if you have the <OpenGL/glu.h> header file. */
|
||||
-/* #undef HAVE_OPENGL_GLU_H */
|
||||
-
|
||||
-/* Define to 1 if you have the <OpenGL/gl.h> header file. */
|
||||
-/* #undef HAVE_OPENGL_GL_H */
|
||||
-
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
/* #undef HAVE_SETMODE */
|
||||
|
||||
@@ -111,18 +87,12 @@
|
||||
/* Define to the full name of this package. */
|
||||
/* #undef PACKAGE_NAME */
|
||||
|
||||
-/* Define to the full name and version of this package. */
|
||||
-/* #undef PACKAGE_STRING */
|
||||
-
|
||||
/* Define to the one symbol short name of this package. */
|
||||
/* #undef PACKAGE_TARNAME */
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
/* #undef PACKAGE_URL */
|
||||
|
||||
-/* Define to the version of this package. */
|
||||
-/* #undef PACKAGE_VERSION */
|
||||
-
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#if SIZE_MAX == 0xffffffff
|
||||
#define SIZEOF_SIZE_T 4
|
||||
@@ -139,9 +109,6 @@
|
||||
/* define to use win32 IO system */
|
||||
/* #undef USE_WIN32_FILEIO */
|
||||
|
||||
-/* Version number of package */
|
||||
-#define VERSION "4.5.1"
|
||||
-
|
||||
/* Support webp compression */
|
||||
/* #undef WEBP_SUPPORT */
|
||||
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h.cmake.in b/src/3rdparty/libtiff/libtiff/tif_config.h.cmake.in
|
||||
index 1547af4..62a4c73 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_config.h.cmake.in
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h.cmake.in
|
||||
@@ -40,18 +40,6 @@
|
||||
/* Define to 1 if you have the `getopt' function. */
|
||||
#cmakedefine HAVE_GETOPT 1
|
||||
|
||||
-/* Define to 1 if you have the <GLUT/glut.h> header file. */
|
||||
-#cmakedefine HAVE_GLUT_GLUT_H 1
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glut.h> header file. */
|
||||
-#cmakedefine HAVE_GL_GLUT_H 1
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glu.h> header file. */
|
||||
-#cmakedefine HAVE_GL_GLU_H 1
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/gl.h> header file. */
|
||||
-#cmakedefine HAVE_GL_GL_H 1
|
||||
-
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
@@ -61,12 +49,6 @@
|
||||
/* Define to 1 if you have the `mmap' function. */
|
||||
#cmakedefine HAVE_MMAP 1
|
||||
|
||||
-/* Define to 1 if you have the <OpenGL/glu.h> header file. */
|
||||
-#cmakedefine HAVE_OPENGL_GLU_H 1
|
||||
-
|
||||
-/* Define to 1 if you have the <OpenGL/gl.h> header file. */
|
||||
-#cmakedefine HAVE_OPENGL_GL_H 1
|
||||
-
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
#cmakedefine HAVE_SETMODE 1
|
||||
|
||||
@@ -100,23 +82,17 @@
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "@PACKAGE_NAME@"
|
||||
|
||||
-/* Define to the full name and version of this package. */
|
||||
-#define PACKAGE_STRING "@PACKAGE_STRING@"
|
||||
-
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "@PACKAGE_URL@"
|
||||
|
||||
-/* Define to the version of this package. */
|
||||
-#define PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
-
|
||||
/* Size of size_t */
|
||||
#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
|
||||
|
||||
/* Default size of the strip in bytes (when strip chopping enabled) */
|
||||
-#define STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@
|
||||
+#cmakedefine STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@
|
||||
|
||||
/** Maximum number of TIFF IFDs that libtiff can iterate through in a file. */
|
||||
#define TIFF_MAX_DIR_COUNT @TIFF_MAX_DIR_COUNT@
|
||||
@@ -124,9 +100,6 @@
|
||||
/* define to use win32 IO system */
|
||||
#cmakedefine USE_WIN32_FILEIO 1
|
||||
|
||||
-/* Version number of package */
|
||||
-#define VERSION "@PACKAGE_VERSION@"
|
||||
-
|
||||
/* Support WEBP compression */
|
||||
#cmakedefine WEBP_SUPPORT 1
|
||||
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h.in b/src/3rdparty/libtiff/libtiff/tif_config.h.in
|
||||
index 87c08bb..28da641 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_config.h.in
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_config.h.in
|
||||
@@ -40,18 +40,6 @@
|
||||
/* Define to 1 if you have the `getopt' function. */
|
||||
#undef HAVE_GETOPT
|
||||
|
||||
-/* Define to 1 if you have the <GLUT/glut.h> header file. */
|
||||
-#undef HAVE_GLUT_GLUT_H
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glut.h> header file. */
|
||||
-#undef HAVE_GL_GLUT_H
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/glu.h> header file. */
|
||||
-#undef HAVE_GL_GLU_H
|
||||
-
|
||||
-/* Define to 1 if you have the <GL/gl.h> header file. */
|
||||
-#undef HAVE_GL_GL_H
|
||||
-
|
||||
/* Define to 1 if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
@@ -61,12 +49,6 @@
|
||||
/* Define to 1 if you have the `mmap' function. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
-/* Define to 1 if you have the <OpenGL/glu.h> header file. */
|
||||
-#undef HAVE_OPENGL_GLU_H
|
||||
-
|
||||
-/* Define to 1 if you have the <OpenGL/gl.h> header file. */
|
||||
-#undef HAVE_OPENGL_GL_H
|
||||
-
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
#undef HAVE_SETMODE
|
||||
|
||||
@@ -103,18 +85,12 @@
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
-/* Define to the full name and version of this package. */
|
||||
-#undef PACKAGE_STRING
|
||||
-
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
-/* Define to the version of this package. */
|
||||
-#undef PACKAGE_VERSION
|
||||
-
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
@@ -127,9 +103,6 @@
|
||||
/* define to use win32 IO system */
|
||||
#undef USE_WIN32_FILEIO
|
||||
|
||||
-/* Version number of package */
|
||||
-#undef VERSION
|
||||
-
|
||||
/* Support webp compression */
|
||||
#undef WEBP_SUPPORT
|
||||
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_dirread.c b/src/3rdparty/libtiff/libtiff/tif_dirread.c
|
||||
index 717cbc8..2c49dc6 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_dirread.c
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_dirread.c
|
||||
@@ -5038,7 +5038,7 @@ static void TIFFReadDirectoryCheckOrder(TIFF *tif, TIFFDirEntry *dir,
|
||||
uint16_t dircount)
|
||||
{
|
||||
static const char module[] = "TIFFReadDirectoryCheckOrder";
|
||||
- uint16_t m;
|
||||
+ uint32_t m;
|
||||
uint16_t n;
|
||||
TIFFDirEntry *o;
|
||||
m = 0;
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_dirwrite.c b/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
|
||||
index a6a485f..d8844bb 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_dirwrite.c
|
||||
@@ -2073,34 +2073,41 @@ static int TIFFWriteDirectoryTagTransferfunction(TIFF *tif, uint32_t *ndir,
|
||||
(*ndir)++;
|
||||
return (1);
|
||||
}
|
||||
+ /* TIFFTAG_TRANSFERFUNCTION expects (1 or 3) pointer to arrays with
|
||||
+ * (1 << BitsPerSample) * uint16_t values.
|
||||
+ */
|
||||
m = (1 << tif->tif_dir.td_bitspersample);
|
||||
- n = tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples;
|
||||
+ /* clang-format off */
|
||||
+ n = (tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples) > 1 ? 3 : 1;
|
||||
+ /* clang-format on */
|
||||
+
|
||||
+ /* Check for proper number of transferfunctions */
|
||||
+ for (int i = 0; i < n; i++)
|
||||
+ {
|
||||
+ if (tif->tif_dir.td_transferfunction[i] == NULL)
|
||||
+ {
|
||||
+ TIFFWarningExtR(
|
||||
+ tif, module,
|
||||
+ "Too few TransferFunctions provided. Tag not written to file");
|
||||
+ return (1); /* Not an error; only tag is not written. */
|
||||
+ }
|
||||
+ }
|
||||
/*
|
||||
* Check if the table can be written as a single column,
|
||||
* or if it must be written as 3 columns. Note that we
|
||||
* write a 3-column tag if there are 2 samples/pixel and
|
||||
* a single column of data won't suffice--hmm.
|
||||
*/
|
||||
- if (n > 3)
|
||||
- n = 3;
|
||||
if (n == 3)
|
||||
{
|
||||
- if (tif->tif_dir.td_transferfunction[2] == NULL ||
|
||||
- !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],
|
||||
+ if (!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],
|
||||
tif->tif_dir.td_transferfunction[2],
|
||||
- m * sizeof(uint16_t)))
|
||||
- n = 2;
|
||||
- }
|
||||
- if (n == 2)
|
||||
- {
|
||||
- if (tif->tif_dir.td_transferfunction[1] == NULL ||
|
||||
+ m * sizeof(uint16_t)) &&
|
||||
!_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],
|
||||
tif->tif_dir.td_transferfunction[1],
|
||||
m * sizeof(uint16_t)))
|
||||
n = 1;
|
||||
}
|
||||
- if (n == 0)
|
||||
- n = 1;
|
||||
o = _TIFFmallocExt(tif, n * m * sizeof(uint16_t));
|
||||
if (o == NULL)
|
||||
{
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tif_webp.c b/src/3rdparty/libtiff/libtiff/tif_webp.c
|
||||
index 07db7cc..bf9d77e 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tif_webp.c
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tif_webp.c
|
||||
@@ -47,9 +47,11 @@ typedef struct
|
||||
{
|
||||
uint16_t nSamples; /* number of samples per pixel */
|
||||
|
||||
- int lossless; /* lossy/lossless compression */
|
||||
- int quality_level; /* compression level */
|
||||
- WebPPicture sPicture; /* WebP Picture */
|
||||
+ int lossless; /* lossy/lossless compression */
|
||||
+ int lossless_exact; /* lossless exact mode. If TRUE, R,G,B values in areas
|
||||
+ with alpha = 0 will be preserved */
|
||||
+ int quality_level; /* compression level */
|
||||
+ WebPPicture sPicture; /* WebP Picture */
|
||||
WebPConfig sEncoderConfig; /* WebP encoder config */
|
||||
uint8_t *pBuffer; /* buffer to hold raw data on encoding */
|
||||
unsigned int buffer_offset; /* current offset into the buffer */
|
||||
@@ -149,6 +151,64 @@ static int TWebPDecode(TIFF *tif, uint8_t *op, tmsize_t occ, uint16_t s)
|
||||
segment_height = td->td_rowsperstrip;
|
||||
}
|
||||
|
||||
+ int webp_width, webp_height;
|
||||
+ if (!WebPGetInfo(tif->tif_rawcp,
|
||||
+ (uint64_t)tif->tif_rawcc > UINT32_MAX
|
||||
+ ? UINT32_MAX
|
||||
+ : (uint32_t)tif->tif_rawcc,
|
||||
+ &webp_width, &webp_height))
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, module, "WebPGetInfo() failed");
|
||||
+ return 0;
|
||||
+ }
|
||||
+ if ((uint32_t)webp_width != segment_width ||
|
||||
+ (uint32_t)webp_height != segment_height)
|
||||
+ {
|
||||
+ TIFFErrorExtR(
|
||||
+ tif, module, "WebP blob dimension is %dx%d. Expected %ux%u",
|
||||
+ webp_width, webp_height, segment_width, segment_height);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+#if WEBP_DECODER_ABI_VERSION >= 0x0002
|
||||
+ WebPDecoderConfig config;
|
||||
+ if (!WebPInitDecoderConfig(&config))
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, module, "WebPInitDecoderConfig() failed");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ const bool bWebPGetFeaturesOK =
|
||||
+ WebPGetFeatures(tif->tif_rawcp,
|
||||
+ (uint64_t)tif->tif_rawcc > UINT32_MAX
|
||||
+ ? UINT32_MAX
|
||||
+ : (uint32_t)tif->tif_rawcc,
|
||||
+ &config.input) == VP8_STATUS_OK;
|
||||
+
|
||||
+ WebPFreeDecBuffer(&config.output);
|
||||
+
|
||||
+ if (!bWebPGetFeaturesOK)
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, module, "WebPInitDecoderConfig() failed");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ const int webp_bands = config.input.has_alpha ? 4 : 3;
|
||||
+ if (webp_bands != sp->nSamples &&
|
||||
+ /* We accept the situation where the WebP blob has only 3 bands,
|
||||
+ * whereas the raster is 4 bands. This can happen when the alpha
|
||||
+ * channel is fully opaque, and WebP decoding works fine in that
|
||||
+ * situation.
|
||||
+ */
|
||||
+ !(webp_bands == 3 && sp->nSamples == 4))
|
||||
+ {
|
||||
+ TIFFErrorExtR(tif, module,
|
||||
+ "WebP blob band count is %d. Expected %d", webp_bands,
|
||||
+ sp->nSamples);
|
||||
+ return 0;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
buffer_size = segment_width * segment_height * sp->nSamples;
|
||||
if (occ == (tmsize_t)buffer_size)
|
||||
{
|
||||
@@ -461,6 +521,9 @@ static int TWebPSetupEncode(TIFF *tif)
|
||||
if (sp->lossless)
|
||||
{
|
||||
sp->sPicture.use_argb = 1;
|
||||
+#if WEBP_ENCODER_ABI_VERSION >= 0x0209
|
||||
+ sp->sEncoderConfig.exact = sp->lossless_exact;
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -695,6 +758,17 @@ static int TWebPVSetField(TIFF *tif, uint32_t tag, va_list ap)
|
||||
"Need to upgrade WEBP driver, this version doesn't support "
|
||||
"lossless compression.");
|
||||
return 0;
|
||||
+#endif
|
||||
+ case TIFFTAG_WEBP_LOSSLESS_EXACT:
|
||||
+#if WEBP_ENCODER_ABI_VERSION >= 0x0209
|
||||
+ sp->lossless_exact = va_arg(ap, int);
|
||||
+ return 1;
|
||||
+#else
|
||||
+ TIFFErrorExtR(
|
||||
+ tif, module,
|
||||
+ "Need to upgrade WEBP driver, this version doesn't support "
|
||||
+ "lossless compression.");
|
||||
+ return 0;
|
||||
#endif
|
||||
default:
|
||||
return (*sp->vsetparent)(tif, tag, ap);
|
||||
@@ -714,6 +788,9 @@ static int TWebPVGetField(TIFF *tif, uint32_t tag, va_list ap)
|
||||
case TIFFTAG_WEBP_LOSSLESS:
|
||||
*va_arg(ap, int *) = sp->lossless;
|
||||
break;
|
||||
+ case TIFFTAG_WEBP_LOSSLESS_EXACT:
|
||||
+ *va_arg(ap, int *) = sp->lossless_exact;
|
||||
+ break;
|
||||
default:
|
||||
return (*sp->vgetparent)(tif, tag, ap);
|
||||
}
|
||||
@@ -726,6 +803,9 @@ static const TIFFField TWebPFields[] = {
|
||||
{TIFFTAG_WEBP_LOSSLESS, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
|
||||
TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "WEBP lossless/lossy",
|
||||
NULL},
|
||||
+ {TIFFTAG_WEBP_LOSSLESS_EXACT, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
|
||||
+ TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "WEBP exact lossless",
|
||||
+ NULL},
|
||||
};
|
||||
|
||||
int TIFFInitWebP(TIFF *tif, int scheme)
|
||||
@@ -764,6 +844,7 @@ int TIFFInitWebP(TIFF *tif, int scheme)
|
||||
/* Default values for codec-specific fields */
|
||||
sp->quality_level = 75; /* default comp. level */
|
||||
sp->lossless = 0; /* default to false */
|
||||
+ sp->lossless_exact = 1; /* exact lossless mode (if lossless enabled) */
|
||||
sp->state = 0;
|
||||
sp->nSamples = 0;
|
||||
sp->psDecoder = NULL;
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tiff.h b/src/3rdparty/libtiff/libtiff/tiff.h
|
||||
index b2d1186..d8da33d 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tiff.h
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tiff.h
|
||||
@@ -646,7 +646,7 @@ typedef enum
|
||||
#define TIFFTAG_EP_EXPOSUREINDEX 37397 /* Exposure index */
|
||||
#define TIFFTAG_EP_STANDARDID 37398 /* TIFF/EP standard version, n.n.n.n */
|
||||
#define TIFFTAG_EP_SENSINGMETHOD 37399 /* Type of image sensor */
|
||||
-/*
|
||||
+/*
|
||||
* TIFF/EP tags equivalent to EXIF tags
|
||||
* Note that TIFF-EP and EXIF use nearly the same metadata tag set, but TIFF-EP stores the tags in IFD 0,
|
||||
* while EXIF store the tags in a separate IFD. Either location is allowed by DNG, but the EXIF location is preferred.
|
||||
@@ -761,6 +761,7 @@ typedef enum
|
||||
#define TIFFTAG_LERC_MAXZERROR 65567 /* LERC maximum error */
|
||||
#define TIFFTAG_WEBP_LEVEL 65568 /* WebP compression level */
|
||||
#define TIFFTAG_WEBP_LOSSLESS 65569 /* WebP lossless/lossy */
|
||||
+#define TIFFTAG_WEBP_LOSSLESS_EXACT 65571 /* WebP lossless exact mode. Set-only mode. Default is 1. Can be set to 0 to increase compression rate, but R,G,B in areas where alpha = 0 will not be preserved */
|
||||
#define TIFFTAG_DEFLATE_SUBCODEC 65570 /* ZIP codec: to get/set the sub-codec to use. Will default to libdeflate when available */
|
||||
#define DEFLATE_SUBCODEC_ZLIB 0
|
||||
#define DEFLATE_SUBCODEC_LIBDEFLATE 1
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h
|
||||
index d6bf0cc..2046054 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tiffio.h
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tiffio.h
|
||||
@@ -277,7 +277,7 @@ typedef struct
|
||||
#define LOGLUV_PUBLIC 1
|
||||
#endif
|
||||
|
||||
-#if defined(__GNUC__) || defined(__attribute__)
|
||||
+#if defined(__GNUC__) || defined(__clang__) || defined(__attribute__)
|
||||
#define TIFF_ATTRIBUTE(x) __attribute__(x)
|
||||
#else
|
||||
#define TIFF_ATTRIBUTE(x) /*nothing*/
|
||||
diff --git a/src/3rdparty/libtiff/libtiff/tiffvers.h b/src/3rdparty/libtiff/libtiff/tiffvers.h
|
||||
index ed84776..892e9a0 100644
|
||||
--- a/src/3rdparty/libtiff/libtiff/tiffvers.h
|
||||
+++ b/src/3rdparty/libtiff/libtiff/tiffvers.h
|
||||
@@ -1,9 +1,14 @@
|
||||
+/* tiffvers.h version information is updated according to version information
|
||||
+ * in configure.ac */
|
||||
+
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format disabled because FindTIFF.cmake is very sensitive to the
|
||||
* formatting of below line being a single line.
|
||||
+ * Furthermore, configure_file variables of type "@VAR@" are
|
||||
+ * modified by clang-format and won't be substituted by CMake.
|
||||
*/
|
||||
-#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.5.1\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
|
||||
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.6.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
|
||||
/*
|
||||
* This define can be used in code that requires
|
||||
* compilation-related definitions specific to a
|
||||
@@ -11,12 +16,13 @@
|
||||
* version checking should be done based on the
|
||||
* string returned by TIFFGetVersion.
|
||||
*/
|
||||
-#define TIFFLIB_VERSION 20230609
|
||||
+#define TIFFLIB_VERSION 20230908
|
||||
|
||||
/* The following defines have been added in 4.5.0 */
|
||||
#define TIFFLIB_MAJOR_VERSION 4
|
||||
-#define TIFFLIB_MINOR_VERSION 5
|
||||
-#define TIFFLIB_MICRO_VERSION 1
|
||||
+#define TIFFLIB_MINOR_VERSION 6
|
||||
+#define TIFFLIB_MICRO_VERSION 0
|
||||
+#define TIFFLIB_VERSION_STR_MAJ_MIN_MIC "4.6.0"
|
||||
|
||||
/* Macro added in 4.5.0. Returns TRUE if the current libtiff version is
|
||||
* greater or equal to major.minor.micro
|
||||
diff --git a/src/3rdparty/libtiff/qt_attribution.json b/src/3rdparty/libtiff/qt_attribution.json
|
||||
index de1f4a3..d4ad361 100644
|
||||
--- a/src/3rdparty/libtiff/qt_attribution.json
|
||||
+++ b/src/3rdparty/libtiff/qt_attribution.json
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
"Description": "",
|
||||
"Homepage": "http://www.simplesystems.org/libtiff/",
|
||||
- "Version": "4.5.1",
|
||||
- "DownloadLocation": "https://download.osgeo.org/libtiff/tiff-4.5.1.tar.gz",
|
||||
+ "Version": "4.6.0",
|
||||
+ "DownloadLocation": "https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz",
|
||||
"License": "libtiff License",
|
||||
"LicenseId": "libtiff",
|
||||
"LicenseFile": "COPYRIGHT",
|
||||
--
|
||||
2.46.0
|
||||
|
Loading…
Reference in new issue