mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-07-11 02:03:22 +00:00
Fix STAT format 4 parsing pointer advance
This commit is contained in:
parent
8d3ba6df60
commit
ce931d8b11
1 changed files with 6 additions and 3 deletions
|
|
@ -273,11 +273,14 @@ read_STAT_font_table(const uint8_t *table, size_t table_len, PyObject *name_look
|
|||
app("sd sd", "value", value, "linked_value", linked_value);
|
||||
} break;
|
||||
case 4: if ((uint8_t*)(p) + 6 * axis_index <= table_limit) {
|
||||
RAII_PyObject(values, PyTuple_New(axis_index));
|
||||
const uint16_t axis_count = axis_index;
|
||||
RAII_PyObject(values, PyTuple_New(axis_count));
|
||||
if (!values) return false;
|
||||
for (uint16_t n = 0; n < axis_index; n++, p += 3) {
|
||||
for (uint16_t n = 0; n < axis_count; n++) {
|
||||
uint16_t actual_axis_index = next;
|
||||
p32 = (uint32_t*)p; double value = next32;
|
||||
p32 = (uint32_t*)p;
|
||||
double value = next32;
|
||||
p = (uint16_t*)p32;
|
||||
PyObject *e = Py_BuildValue("{sH sd}", "design_index", actual_axis_index, "value", value);
|
||||
if (!e) return false;
|
||||
PyTuple_SET_ITEM(values, n, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue