The code below generates this error (appending to exporters
):
fatal error: UnsafeMutablePointer.deinitialize with negative count
var exporters = [AVAssetExportSession]()
let exporter = AVAssetExportSession(asset: mainComposition, presetName: AVAssetExportPresetHighestQuality)!
exporter.videoComposition = videoComposition
exporter.outputFileType = AVFileTypeMPEG4
exporter.outputURL = exportURL
exporter.shouldOptimizeForNetworkUse = true
exporters.append(exporter)
The other posts on StackOverflow regarding UnsafeMutablePointer.deinitialize
do not shed much light on the issue, which doesn't happen consistently.
Any ideas?