From 60846b2b7aabcf1406d763c7e7f9155481f9783d Mon Sep 17 00:00:00 2001 From: David Geldreich Date: Fri, 15 Jul 2022 19:35:32 +0200 Subject: [PATCH] correct an issue of trackbar on macOS Python binding is passing NULL as (int*)value. sliderChanged crash when trying to dereference value --- modules/highgui/src/window_cocoa.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/highgui/src/window_cocoa.mm b/modules/highgui/src/window_cocoa.mm index e9cf5a3c1b..ef3f828cf8 100644 --- a/modules/highgui/src/window_cocoa.mm +++ b/modules/highgui/src/window_cocoa.mm @@ -1201,7 +1201,7 @@ static NSSize constrainAspectRatio(NSSize base, NSSize constraint) { (void)notification; int pos = [slider intValue]; NSString *temp = [self initialName]; - NSString *text = [NSString stringWithFormat:@"%@ %d", temp, *value]; + NSString *text = [NSString stringWithFormat:@"%@ %d", temp, pos]; [name setStringValue: text]; if(value) *value = pos;