Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tx] ignore subr recursion limit #1484

Merged
merged 3 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c/shared/include/t2cstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "ctlshare.h"

#define T2C_VERSION CTL_MAKE_VERSION(1, 0, 22)
#define T2C_VERSION CTL_MAKE_VERSION(1, 0, 23)

#include "absfont.h"

Expand Down
6 changes: 2 additions & 4 deletions c/shared/source/t2cstr/t2cstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,7 @@ static int t2Decode(t2cCtx h, long offset, int depth) {
h->src.endOffset = h->aux->subrsEnd;
h->subrDepth++;
if (h->subrDepth > TX_MAX_SUBR_DEPTH) {
message(h, "subr depth: %d\n", h->subrDepth);
return t2cErrSubrDepth;
message(h, "subr depth %d exceeds recursion limit %d (ignored)", h->subrDepth, TX_MAX_SUBR_DEPTH);
}

result = t2Decode(h, h->aux->subrs.offset[num], depth + 1);
Expand Down Expand Up @@ -1606,8 +1605,7 @@ static int t2Decode(t2cCtx h, long offset, int depth) {

h->subrDepth++;
if (h->subrDepth > TX_MAX_SUBR_DEPTH) {
message(h, "subr depth: %d\n", h->subrDepth);
return t2cErrSubrDepth;
message(h, "subr depth %d exceeds recursion limit %d (ignored)", h->subrDepth, TX_MAX_SUBR_DEPTH);
}

result = t2Decode(h, h->aux->gsubrs.offset[num], depth + 1);
Expand Down