Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Source: https://github.com/KhronosGroup/KTX-Software
# general wildcards go first.

# The majority of images & icons fall under the Khronos license
Files: */*.png */*.ktx */*.ico */*.icns */*.jpg */*.pam */*.pgm */*.ppm */*.ktx */*.ktx2 */*.basis */*.pspimage
Copyright: 2015-2020 The Khronos Group Inc.
Files: */*.bmp */*.png */*.ico */*.icns */*.jpg */*.pam */*.pgm */*.ppm */*.ktx */*.ktx2 */*.basis */*.pspimage
Copyright: 2015-2022 The Khronos Group Inc.
License: Apache-2.0

## Exceptions to the above ...
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ install:
case "${TRAVIS_OS_NAME:-linux}" in
linux)
if [ "$CHECK_REUSE" = "YES" -o "$CHECK_REUSE" = "ONLY" ]; then
set -e # because the if below swallows a bad exit status.
pip3 install reuse
set +e
fi
if [ "$CHECK_REUSE" != "ONLY" -a "$WASM_BUILD" != "YES" ]; then
./ci_scripts/install_linux.sh
Expand Down Expand Up @@ -202,7 +204,9 @@ script:
echo "CHECK_REUSE = $CHECK_REUSE"
if [ "$CHECK_REUSE" = "YES" -o "$CHECK_REUSE" = "ONLY" ]; then
echo "Calling reuse lint."
set -e # because the if below swallows a bad exit status.
reuse lint
set +e
fi
if [ "$CHECK_REUSE" != "ONLY" ]; then
if [ "$WASM_BUILD" = "YES" ]; then
Expand Down
2 changes: 1 addition & 1 deletion interface/java_binding/src/main/cpp/ktx-jni.manifest.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<!-- Copyright 2022 The Khronos Group Inc. -->
<!-- SPDX-License-Identifier: Apache-1.0 -->
<!-- SPDX-License-Identifier: Apache-2.0 -->

<!-- This is to make testing during build work. It also makes the
installed software more secure as Windows will only look for
Expand Down
6 changes: 4 additions & 2 deletions lib/basis_transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ ktxTexture2_transcodeUastc(ktxTexture2* This,
uint32_t* BDB = This->pDfd + 1;
khr_df_model_e colorModel = (khr_df_model_e)KHR_DFDVAL(BDB, MODEL);
if (colorModel != KHR_DF_MODEL_UASTC
// Constructor has checked color model matches BASIS_LZ.
&& This->supercompressionScheme != KTX_SS_BASIS_LZ)
return KTX_INVALID_OPERATION; // Not in a transcodable format.
{
return KTX_INVALID_OPERATION; // Not in a transcodable format.
}

DECLARE_PRIVATE(priv, This);
if (This->supercompressionScheme == KTX_SS_BASIS_LZ) {
Expand Down Expand Up @@ -174,7 +177,6 @@ ktxTexture2_transcodeUastc(ktxTexture2* This,
}
}
} else {
assert(colorModel == KHR_DF_MODEL_UASTC);
uint32_t channelId = KHR_DFDSVAL(BDB, 0, CHANNELID);
if (channelId == KHR_DF_CHANNEL_UASTC_RGBA)
alphaContent = eAlpha;
Expand Down
7 changes: 7 additions & 0 deletions lib/texture2.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,13 @@ ktxTexture2_constructFromStreamAndHeader(ktxTexture2* This, ktxStream* pStream,
}
This->isCompressed = (This->_protected->_formatSize.flags & KTX_FORMAT_SIZE_COMPRESSED_BIT);

if (This->supercompressionScheme == KTX_SS_BASIS_LZ
&& KHR_DFDVAL(This->pDfd + 1, MODEL) != KHR_DF_MODEL_ETC1S)
{
result = KTX_FILE_DATA_ERROR;
goto cleanup;
}

This->_private->_requiredLevelAlignment
= ktxTexture2_calcRequiredLevelAlignment(This);

Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions tools/ktx2check/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PRIVATE

set_target_properties(
ktx2check PROPERTIES
CXX_VISIBILITY_PRESET ${STATIC_APP_LIB_SYMBOL_VISIBILITY}
# Force C++14 (for std::make_unique on AppleClang and Linux GCC)
CXX_STANDARD 14
CXX_STANDARD_REQUIRED YES
Expand Down