How to avoid malloc while using CGImageDestinationFinalize
问题 I am trying to programmatically create GIF in iOS, using the following stack's question: Create and and export an animated gif via iOS? My code looks like this: // File Parameters const void *keys[] = { kCGImagePropertyGIFLoopCount }; const void *values[] = { (CFNumberRef) 0 }; CFDictionaryRef params = CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL); const void *keys2[] = { kCGImagePropertyGIFDictionary }; const void *values2[] = { (CFDictionaryRef) params }; CFDictionaryRef