The string is allocated with CFStringGetCString but was being deallocated with free(), which would intermittently result in a segmentation fault. Use the correct function for freeing the allocated CFString.
Showing the changes to libavdevice/decklink_common.cpp (1 of 1 file). Show all
Unified · Split
| @@ -84,7 +84,7 @@ static char *dup_cfstring_to_utf8(CFStringRef w) · 83 unmodified lines | |||
| 84 | } | 84 | } |
| 85 | #define DECKLINK_STR const __CFString * | 85 | #define DECKLINK_STR const __CFString * |
| 86 | #define DECKLINK_STRDUP dup_cfstring_to_utf8 | 86 | #define DECKLINK_STRDUP dup_cfstring_to_utf8 |
| 87 | #define DECKLINK_FREE(s) free((void *) s) | 87 | #define DECKLINK_FREE(s) CFRelease(s) |
| 88 | #define DECKLINK_BOOL bool | 88 | #define DECKLINK_BOOL bool |
| 89 | #else | 89 | #else |
| 90 | #define DECKLINK_STR const char * | 90 | #define DECKLINK_STR const char * |