Compositor: Assert for invalid pixel access

This commit is contained in:
Omar Emara
2024-12-03 12:21:31 +02:00
parent f6c30bfe45
commit 03b3f69e33

View File

@@ -833,6 +833,9 @@ inline float4 Result::sample_ewa_zero(const float2 &coordinates,
inline int64_t Result::get_pixel_index(const int2 &texel) const
{
BLI_assert(!is_single_value_);
BLI_assert(this->is_allocated());
BLI_assert(texel.x >= 0 && texel.y >= 0 && texel.x < domain_.size.x && texel.y < domain_.size.y);
return (int64_t(texel.y) * domain_.size.x + texel.x) * this->channels_count();
}