fix the case of an empty chart

This commit is contained in:
Krasimir Angelov
2026-08-20 13:13:59 +02:00
parent 17a308972a
commit 83700a62a2
+4 -2
View File
@@ -1676,8 +1676,10 @@ bool PgfParser::change(size_t i, PgfText *change)
allocated_size = new_allocated_size; allocated_size = new_allocated_size;
} }
const uint8_t *ptr1 = (uint8_t *) const uint8_t *ptr1 =
&sentence->text[prev_state->start.byte_pos]; (prev_state!=NULL)
? (uint8_t *) &sentence->text[prev_state->start.byte_pos]
: NULL;
size_t pos = prev_state->start.pos; size_t pos = prev_state->start.pos;
while (pos < update_new_pos) { while (pos < update_new_pos) {
pgf_utf8_decode(&ptr1); pos++; pgf_utf8_decode(&ptr1); pos++;