fix: prevent IPC slot reuse during object teardown
This commit is contained in:
@@ -121,8 +121,13 @@ struct TrueTypeFont {
|
||||
return false;
|
||||
}
|
||||
|
||||
montauk::read(fd, data, 0, size);
|
||||
int read_result = montauk::read(fd, data, 0, size);
|
||||
montauk::close(fd);
|
||||
if (read_result < 0 || (uint64_t)read_result != size) {
|
||||
montauk::free(data);
|
||||
data = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
// stbtt_GetFontOffsetForIndex returns -1 for non-font data; passing
|
||||
// that into stbtt_InitFont makes it dereference data + (uint32)-1.
|
||||
|
||||
Reference in New Issue
Block a user