Skip to content

Commit

Permalink
wineps.drv: Don't crash if specified font is missing required table i…
Browse files Browse the repository at this point in the history
…n T42_download_header.
  • Loading branch information
PiotrCW authored and julliard committed Sep 20, 2023
1 parent 8f890d4 commit d598825
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dlls/wineps.drv/type42.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit d598825

Please sign in to comment.