mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-22 11:56:49 +01:00
Batching - fix uninitialized color read
Valgrind was showing a read from uninitialized memory. r_fill_state.curr_batch->color is unset (for performance reasons), so can contain random data. This actually doesn't matter in practice, since logically this uninitialized state can only occur when change_batch is set, and the only side effect is that change_batch is set. Hence why no bugs occur in practice. This PR prevents this read from uninitialized data. It is likely free in terms of performance after optimization, and keeps the Valgrind logs clearer, so why not.
This commit is contained in:
parent
4237a6501f
commit
a39a25694d
@ -1334,7 +1334,7 @@ PREAMBLE(bool)::_prefill_line(RasterizerCanvas::Item::CommandLine *p_line, FillS
|
||||
|
||||
// if the color has changed we need a new batch
|
||||
// (only single color line batches supported so far)
|
||||
if (r_fill_state.curr_batch->color != bcol) {
|
||||
if (!change_batch && r_fill_state.curr_batch->color != bcol) {
|
||||
change_batch = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user