Module: wine Branch: master Commit: d5988259c110dca1e24d12b6114ed1d2e0f7fea6 URL: https://gitlab.winehq.org/wine/wine/-/commit/d5988259c110dca1e24d12b6114ed1d...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Sep 19 19:41:45 2023 +0200
wineps.drv: Don't crash if specified font is missing required table in T42_download_header.
---
dlls/wineps.drv/type42.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/wineps.drv/type42.c b/dlls/wineps.drv/type42.c index e495ddc0394..0867881b68e 100644 --- a/dlls/wineps.drv/type42.c +++ b/dlls/wineps.drv/type42.c @@ -170,7 +170,6 @@ TYPE42 *T42_download_header(print_ctx *ctx, char *ps_name,
t42 = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*t42)); memcpy(t42->tables, tables_templ, sizeof(tables_templ)); - t42->loca_tab = t42->glyf_tab = t42->head_tab = -1; t42->emsize = emsize; t42->num_of_written_tables = 0;
@@ -186,6 +185,9 @@ TYPE42 *T42_download_header(print_ctx *ctx, char *ps_name, t42->head_tab = i; else if(t42->tables[i].MS_tag == MS_MAKE_TAG('m','a','x','p')) t42->maxp_tab = i; + else + continue; + if(!t42->tables[i].len) break; } if(i < num_of_tables) { TRACE("Table %ld has length %ld. Will use Type 1 font instead.\n", i, t42->tables[i].len);