Skip to content

Commit

Permalink
fontselect: don't leak substitution fullname array if it's empty
Browse files Browse the repository at this point in the history
Discovered by OSS-Fuzz.

This is a longstanding bug (since 0.13.0 released in 2015, when
the new fontselect was first introduced), but it should be rare:
it only manifests when Fontconfig has no substitutions configured
(which is unusual) or when font name strdups fail.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39257.
  • Loading branch information
astiob committed Sep 25, 2021
1 parent 2b30c69 commit 4c3ace7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libass/ass_fontselect.c
Expand Up @@ -856,6 +856,7 @@ static char *select_font(ASS_FontSelector *priv,
}

if (!meta.n_fullname) {
free(meta.fullnames);
meta = default_meta;
}

Expand Down

0 comments on commit 4c3ace7

Please sign in to comment.