]> git.sesse.net Git - narabu/commitdiff
Add an assert to die early if the shader really fails.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 17 Oct 2017 21:13:12 +0000 (23:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 17 Oct 2017 21:13:12 +0000 (23:13 +0200)
narabu-encoder.cpp

index febe2148d2d6ed1c9499d3f9542f6394d8282f94..36804d616f70681f411af412961a23ac87a542b4 100644 (file)
@@ -401,6 +401,7 @@ int main(int argc, char **argv)
                                const uint8_t *out_end = data + (stream_idx * 64 + y * 8 + x + 1) * 1024;
                                const uint8_t *ptr = data + offsets[stream_idx * 64 + y * 8 + x];
                                uint32_t num_rans_bytes = out_end - ptr;
+                               assert(num_rans_bytes <= 1024);
 
                                if (num_rans_bytes == last_block.size() &&
                                    memcmp(last_block.data(), ptr, last_block.size()) == 0) {