assertion "item->token_type == TT_Dict" failed in parse_fonts
Seen in 20221020/3a43ec6ad68a20628ced8feca84e179c4487286773b6168485d713a120125b91
of the instigator corpus.
Backtrace:
#0 thrkill () at /tmp/-:3
#1 0xbcb8cbd77ac20399 in ?? ()
#2 0x000006e46efe52ae in _libc_abort () at /usr/src/lib/libc/stdlib/abort.c:51
#3 0x000006e46efff712 in _libc___assert2 (file=Variable "file" is not available.
)
at /usr/src/lib/libc/gen/assert.c:52
#4 0x000006e26df801e5 in parse_fonts (dict_t=0x6e4bda075b8,
pgRsrc=0x6e52e9b7158, aux=0x7f7fffff4f98) at pdf.c:3725
#5 0x000006e26df80bb5 in parse_rsrcdict (arena=0x6e4f1d16e80,
dict_t=0x6e4bda075b8, pgNode=0x6e499728018, aux=0x7f7fffff4f98)
at pdf.c:3885
#6 0x000006e26df814f4 in parse_pagenode (aux=0x7f7fffff4f98,
myNode=0x6e499728018, myRef=0x6e4b93c19c8, myDict=0x6e49988e448,
parent_t=0x6e497743d68, parent_n=0x7f7fffff4ff0, arena=0x6e4f1d237c0)
at pdf.c:4028
#7 0x000006e26df822b8 in parse_pagetree (aux=0x7f7fffff4f98,
myNode=0x7f7fffff4ff0, myRef=0x6e497743d68, myDict=0x6e4e9538538,
parent_t=0x0, parent_n=0x0) at pdf.c:4255
#8 0x000006e26df8255d in parse_catalog (aux=0x7f7fffff4f98,
root=0x6e54b58c880) at pdf.c:4326
#9 0x000006e26df83c1f in parse_xrefs (aux=0x7f7fffff4f98) at pdf.c:4947
#10 0x000006e26df84531 in main (argc=1, argv=0x7f7fffff5170) at pdf.c:5128
Context:
#4 0x000006e26df801e5 in parse_fonts (dict_t=0x6e4bda075b8,
pgRsrc=0x6e52e9b7158, aux=0x7f7fffff4f98) at pdf.c:3725
3725 assert(item->token_type == TT_Dict);
Current language: auto; currently minimal
(gdb) list
3720
3721 // Handle a dictionary of font resources
3722 item = dictentry(fontdict, "Font");
3723 item = resolve(aux, item);
3724 if (item) { // TODO: Failure ==> xref error -- Figure out how to handle
3725 assert(item->token_type == TT_Dict);
3726 processed = true;
3727 Dict *fontlist = H_CAST(Dict, item);
3728 if (pgRsrc->fonts) {
3729 log_message(SEV_DONTCARE, "\n\nparse_fonts: Attempt to add fonts -- Supported??\n\n");
(gdb) print item
$1 = (const HParsedToken *) 0x6e54f237e10
(gdb) print item->token_type
$2 = TT_SEQUENCE