Skip to content

Commit 1836655

Browse files
committed
merge with upstream
1 parent 50a0ad5 commit 1836655

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+466
-258
lines changed

3rdparty/libjxl/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.11.2] - 2026-02-10
9+
10+
### Fixed
11+
- fix tile dimension in low memory rendering pipeline (#4495 -
12+
[CVE-2025-12474](https://www.cve.org/cverecord?id=CVE-2025-12474))
13+
- fix number of channels for gray-to-gray color transform (#4579 -
14+
[CVE-2026-1837](https://www.cve.org/cverecord?id=CVE-2026-1837))
15+
- `djxl`: reject decoding JXL files if "packed" representation size overflows
16+
`size_t` (#4589 - thanks to Mateusz Jurczyk of Google Project Zero for
17+
identifying this issue)
18+
819
## [0.11.1] - 2024-26-11
920

1021
### Fixed

3rdparty/libjxl/MODULE.bazel

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
# Use of this source code is governed by a BSD-style
44
# license that can be found in the LICENSE file.
55

6-
bazel_dep(name = "bazel_skylib", version = "1.7.1")
7-
bazel_dep(name = "giflib", version = "5.2.1")
6+
module(
7+
name = "libjxl",
8+
repo_name = "libjxl",
9+
)
10+
11+
bazel_dep(name = "bazel_skylib", version = "1.8.2")
12+
bazel_dep(name = "brotli", version = "1.1.0")
13+
bazel_dep(name = "giflib", version = "5.2.1.bcr.1")
814
bazel_dep(name = "googletest", version = "1.14.0")
915
bazel_dep(name = "libjpeg_turbo", version = "2.1.91")
10-
bazel_dep(name = "libpng", version = "1.6.40")
11-
bazel_dep(name = "libwebp", version = "1.3.2")
16+
bazel_dep(name = "libpng", version = "1.6.50.bcr.1")
17+
bazel_dep(name = "libwebp", version = "1.6.0")
1218
bazel_dep(name = "openexr", version = "3.2.1")
19+
bazel_dep(name = "skcms", version = "20250916.0")
20+
21+
# Requires patching `MODULE.bazel` and `BUILD` files
22+
bazel_dep(name = "highway", version = "1.2.0")
23+
local_path_override(
24+
module_name = "highway",
25+
path = "third_party/highway",
26+
)

3rdparty/libjxl/MODULE.bazel.lock

Lines changed: 162 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3rdparty/libjxl/WORKSPACE

Lines changed: 0 additions & 37 deletions
This file was deleted.

3rdparty/libjxl/ci.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ OS=`uname -s`
1515
SELF=$(realpath "$0")
1616
MYDIR=$(dirname "${SELF}")
1717

18+
### Colors
19+
TEXT_BOLD_PURPLE="\033[1;35m"
20+
TEXT_RESET="\033[0m"
21+
1822
### Environment parameters:
1923
TEST_STACK_LIMIT="${TEST_STACK_LIMIT:-256}"
2024
BENCHMARK_NUM_THREADS="${BENCHMARK_NUM_THREADS:-0}"
@@ -40,6 +44,7 @@ fi
4044
POST_MESSAGE_ON_ERROR="${POST_MESSAGE_ON_ERROR:-1}"
4145
# By default, do a lightweight debian HWY package build.
4246
HWY_PKG_OPTIONS="${HWY_PKG_OPTIONS:---set-envvar=HWY_EXTRA_CONFIG=-DBUILD_TESTING=OFF -DHWY_ENABLE_EXAMPLES=OFF -DHWY_ENABLE_CONTRIB=OFF}"
47+
EXCLUDE_DEBIAN_PACKAGES="${EXCLUDE_DEBIAN_PACKAGES:-}"
4348

4449
# Set default compilers to clang if not already set
4550
export CC=${CC:-clang}
@@ -708,7 +713,9 @@ cmd_msan_install() {
708713
["15"]="15.0.7"
709714
["16"]="16.0.6"
710715
["17"]="17.0.6"
711-
["18"]="18.1.6"
716+
["18"]="18.1.8"
717+
["19"]="19.1.7"
718+
["20"]="20.1.2"
712719
)
713720
local llvm_tag="${CLANG_VERSION}.0.0"
714721
if [[ -n "${llvm_tag_by_version["${CLANG_VERSION}"]}" ]]; then
@@ -1221,6 +1228,8 @@ cmd_lint() {
12211228
echo 'To fix them run (from the base directory):' >&2
12221229
echo ' buildifier `git ls-files | grep -E "/BUILD$|WORKSPACE|.bzl$"`' >&2
12231230
fi
1231+
else
1232+
echo -e "${TEXT_BOLD_PURPLE}SKIPPED:${TEXT_RESET} buildifier (not installed)"
12241233
fi
12251234

12261235
# It is ok, if spell-checker is not installed.
@@ -1229,7 +1238,7 @@ cmd_lint() {
12291238
local sources=`git -C "${MYDIR}" ls-files | grep -E "\.(${src_ext})$"`
12301239
typos -c "${MYDIR}/tools/scripts/typos.toml" ${sources}
12311240
else
1232-
echo "Consider installing https://github.com/crate-ci/typos for spell-checking"
1241+
echo -e "${TEXT_BOLD_PURPLE}SKIPPED:${TEXT_RESET} typos not installed; try: cargo install typos-cli"
12331242
fi
12341243

12351244
local installed=()
@@ -1370,6 +1379,11 @@ build_debian_pkg() {
13701379
ln -s "${srcdir}/$f" "${builddir}/$f"
13711380
fi
13721381
done
1382+
if [[ -n "${EXCLUDE_DEBIAN_PACKAGES}" ]]; then
1383+
# TODO(eustas): support comma-separated list
1384+
rm -f "${builddir}"/debian/${EXCLUDE_DEBIAN_PACKAGES}.install
1385+
sed -i "/Package: ${EXCLUDE_DEBIAN_PACKAGES}/,/\n/d" "${builddir}"/debian/control
1386+
fi
13731387
(
13741388
cd "${builddir}"
13751389
debuild "${options}" -b -uc -us

3rdparty/libjxl/deps.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ MYDIR=$(dirname "${SELF}")
1616
# update a git submodule.
1717
TESTDATA="873045a9c42ed60721756e26e2a6b32e17415205"
1818
THIRD_PARTY_BROTLI="36533a866ed1ca4b75cf049f4521e4ec5fe24727"
19-
THIRD_PARTY_GOOGLETEST="58d77fa8070e8cec2dc1ed015d66b454c8d78850"
20-
THIRD_PARTY_HIGHWAY="457c891775a7397bdb0376bb1031e6e027af1c48"
21-
THIRD_PARTY_SKCMS="42030a771244ba67f86b1c1c76a6493f873c5f91"
22-
THIRD_PARTY_SJPEG="e5ab13008bb214deb66d5f3e17ca2f8dbff150bf"
19+
THIRD_PARTY_GOOGLETEST="6910c9d9165801d8827d628cb72eb7ea9dd538c5" # v1.16.0
20+
THIRD_PARTY_HIGHWAY="457c891775a7397bdb0376bb1031e6e027af1c48" # v1.2.0
21+
THIRD_PARTY_SKCMS="b2e692629c1fb19342517d7fb61f1cf83d075492"
22+
THIRD_PARTY_SJPEG="94e0df6d0f8b44228de5be0ff35efb9f946a13c9" # Wed Apr 2 15:42:02 2025 -0700
2323
THIRD_PARTY_ZLIB="51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf" # v1.3.1
24-
THIRD_PARTY_LIBPNG="f135775ad4e5d4408d2e12ffcc71bb36e6b48551" # v1.6.40
24+
THIRD_PARTY_LIBPNG="872555f4ba910252783af1507f9e7fe1653be252" # v1.6.47
2525
THIRD_PARTY_LIBJPEG_TURBO="8ecba3647edb6dd940463fedf38ca33a8e2a73d1" # 2.1.5.1
2626

2727
# Download the target revision from GitHub.

3rdparty/libjxl/lib/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set(JPEGXL_MAJOR_VERSION 0)
77
set(JPEGXL_MINOR_VERSION 11)
8-
set(JPEGXL_PATCH_VERSION 1)
8+
set(JPEGXL_PATCH_VERSION 2)
99
set(JPEGXL_LIBRARY_VERSION
1010
"${JPEGXL_MAJOR_VERSION}.${JPEGXL_MINOR_VERSION}.${JPEGXL_PATCH_VERSION}")
1111

3rdparty/libjxl/lib/extras/packed_image.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class PackedImage {
3636
public:
3737
static StatusOr<PackedImage> Create(size_t xsize, size_t ysize,
3838
const JxlPixelFormat& format) {
39+
JXL_RETURN_IF_ERROR(VerifyDimensions(xsize, ysize, format));
3940
PackedImage image(xsize, ysize, format, CalcStride(format, xsize));
4041
if (!image.pixels()) {
4142
// TODO(szabadka): use specialized OOM error code
@@ -149,6 +150,28 @@ class PackedImage {
149150
}
150151
}
151152

153+
static Status VerifyDimensions(size_t xsize, size_t ysize,
154+
const JxlPixelFormat& format) {
155+
size_t multiplier = (BitsPerChannel(format.data_type) *
156+
format.num_channels / jxl::kBitsPerByte);
157+
size_t stride = xsize * multiplier;
158+
if ((stride / multiplier) != xsize) {
159+
return JXL_FAILURE("Image too big");
160+
}
161+
if (format.align > 1) {
162+
size_t aligned_stride = jxl::DivCeil(stride, format.align) * format.align;
163+
if (stride > aligned_stride) {
164+
return JXL_FAILURE("Image too big");
165+
}
166+
stride = aligned_stride;
167+
}
168+
size_t pixels_size = ysize * stride;
169+
if ((pixels_size / stride) != ysize) {
170+
return JXL_FAILURE("Image too big");
171+
}
172+
return true;
173+
}
174+
152175
private:
153176
PackedImage(size_t xsize, size_t ysize, const JxlPixelFormat& format,
154177
size_t stride)

3rdparty/libjxl/lib/include/jxl/encode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ typedef enum {
352352
*
353353
* When using streaming input and output the encoder minimizes memory usage at
354354
* the cost of compression density. Also note that images produced with
355-
* streaming mode might not be progressively decodeable.
355+
* streaming mode might not be progressively decodable.
356356
*/
357357
JXL_ENC_FRAME_SETTING_BUFFERING = 34,
358358

3rdparty/libjxl/lib/jpegli/entropy_coding.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ void ClusterJpegHistograms(j_compress_ptr cinfo, const Histogram* histograms,
604604
slot_histograms.push_back(histogram_index);
605605
slot_costs.push_back(best_cost);
606606
} else {
607-
// TODO(szabadka) Find the best histogram to replce.
607+
// TODO(szabadka) Find the best histogram to replace.
608608
best_slot = (clusters->slot_ids.back() + 1) % 4;
609609
}
610610
slot_histograms[best_slot] = histogram_index;

0 commit comments

Comments
 (0)