Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit fc1f330

Browse files
committed
Fix buffer sizes of BC1 images.
1 parent b9029f1 commit fc1f330

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/dds/dds.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ vector<std::uint64_t> bc1_encode(
6363
const todds::format::quality quality, const bool alpha_black, const vector<std::uint32_t>& image) {
6464
constexpr std::size_t grain_size = 64ULL;
6565
static oneapi::tbb::affinity_partitioner partitioner;
66+
const std::size_t num_blocks = image.size() / pixel_block_size;
6667

67-
vector<std::uint64_t> result(image.size() * bc1_block_size);
68+
vector<std::uint64_t> result(num_blocks * bc1_block_size);
6869

6970
const auto factors = impl::from_quality_level(static_cast<unsigned int>(quality), alpha_black);
7071

71-
const std::size_t num_blocks = image.size() / pixel_block_size;
7272
oneapi::tbb::parallel_for(
7373
blocked_range(0UL, num_blocks, grain_size),
7474
[factors, &image, &result](const blocked_range& range) {

0 commit comments

Comments
 (0)