Skip to content

Commit 2f713ff

Browse files
committed
Add more promises
1 parent 8efad05 commit 2f713ff

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Source/astcenc_ideal_endpoints_and_weights.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ float compute_error_of_weight_set_1plane(
692692
) {
693693
vfloatacc error_summav = vfloatacc::zero();
694694
unsigned int texel_count = di.texel_count;
695+
promise(texel_count > 0);
695696

696697
// Process SIMD-width chunks, safe to over-fetch - the extra space is zero initialized
697698
if (di.max_texel_weight_count > 2)
@@ -757,6 +758,7 @@ float compute_error_of_weight_set_2planes(
757758
) {
758759
vfloatacc error_summav = vfloatacc::zero();
759760
unsigned int texel_count = di.texel_count;
761+
promise(texel_count > 0);
760762

761763
// Process SIMD-width chunks, safe to over-fetch - the extra space is zero initialized
762764
if (di.max_texel_weight_count > 2)

Source/astcenc_integer_sequence.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,6 @@ void encode_ise(
639639
// Write out just bits
640640
else
641641
{
642-
promise(character_count > 0);
643642
for (unsigned int i = 0; i < character_count; i++)
644643
{
645644
write_bits(input_data[i], bits, bit_offset, output_data);
@@ -708,6 +707,7 @@ void decode_ise(
708707
if (trits)
709708
{
710709
unsigned int trit_blocks = (character_count + 4) / 5;
710+
promise(trit_blocks > 0);
711711
for (unsigned int i = 0; i < trit_blocks; i++)
712712
{
713713
const uint8_t *tritptr = trits_of_integer[tq_blocks[i]];
@@ -722,6 +722,7 @@ void decode_ise(
722722
if (quints)
723723
{
724724
unsigned int quint_blocks = (character_count + 2) / 3;
725+
promise(quint_blocks > 0);
725726
for (unsigned int i = 0; i < quint_blocks; i++)
726727
{
727728
const uint8_t *quintptr = quints_of_integer[tq_blocks[i]];

0 commit comments

Comments
 (0)