summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index abead0fb53..b4283bbe8d 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -172,8 +172,10 @@ static void set_application_icon(NSApplication *app)
NSBundle *bundle = [NSBundle mainBundle];
if ([bundle pathForResource:@"icon" ofType:@"icns"])
return;
+
+ // The C string contains a trailing null, so we strip it away
NSData *icon_data = [NSData dataWithBytesNoCopy:(void *)macosx_icon
- length:sizeof(macosx_icon)
+ length:sizeof(macosx_icon) - 1
freeWhenDone:NO];
NSImage *icon = [[NSImage alloc] initWithData:icon_data];
[app setApplicationIconImage:icon];