]> granicus.if.org Git - libass/commitdiff
coretext: fix sizeof vs. strlen
authorwm4 <wm4@nowhere>
Tue, 1 Sep 2015 12:31:21 +0000 (14:31 +0200)
committerwm4 <wm4@nowhere>
Tue, 1 Sep 2015 12:31:21 +0000 (14:31 +0200)
libass/ass_coretext.c

index 0e943666bd57e605a5a38e66aeb073fd4e452ab1..4b72ef2c2a3db918f1727d392b3ee831f3f1a4a0 100644 (file)
@@ -245,9 +245,8 @@ static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider,
 
 static char *get_fallback(void *priv, const char *family, uint32_t codepoint)
 {
-    char *failed = family;
     CFStringRef name = CFStringCreateWithBytes(
-        0, (UInt8 *)failed, sizeof(failed), kCFStringEncodingUTF8, false);
+        0, (UInt8 *)family, strlen(family), kCFStringEncodingUTF8, false);
     CTFontRef font = CTFontCreateWithName(name, 0, NULL);
     uint32_t codepointle = OSSwapHostToLittleInt32(codepoint);
     CFStringRef r = CFStringCreateWithBytes(