diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2015-12-01 18:31:33 +0200 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2015-12-01 18:31:33 +0200 |
commit | 04b87ca2e6770b1b11e8e5503b43065ac9043390 (patch) | |
tree | 12c21c3f44f507eedc883263b5c816b6a0f8d182 | |
parent | 5f9f485b7f053629ae67d0732fcdf3254450695e (diff) | |
download | libass-04b87ca2e6770b1b11e8e5503b43065ac9043390.tar.bz2 libass-04b87ca2e6770b1b11e8e5503b43065ac9043390.tar.xz |
coretext: don't fetch character set when it isn't needed
This avoids unnecessary work and fixes a memory leak:
the character set wasn't released when code == 0.
-rw-r--r-- | libass/ass_coretext.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c index f480d3c..d749df0 100644 --- a/libass/ass_coretext.c +++ b/libass/ass_coretext.c @@ -71,6 +71,9 @@ static bool check_postscript(void *priv) static bool check_glyph(void *priv, uint32_t code) { + if (code == 0) + return true; + CTFontDescriptorRef fontd = priv; CFCharacterSetRef set = CTFontDescriptorCopyAttribute(fontd, kCTFontCharacterSetAttribute); @@ -78,9 +81,6 @@ static bool check_glyph(void *priv, uint32_t code) if (!set) return true; - if (code == 0) - return true; - bool result = CFCharacterSetIsLongCharacterMember(set, code); SAFE_CFRelease(set); return result; |