malloc error - incorrect checksum for freed object - object was probably modified after being freed
问题 I'm trying to get sub data of NSData object and at the same time multiple bytes by some value for my personal need . actually this affect the volume of .wav sound file . but i get after few calls to the following function a malloc error at the malloc statement . +(NSData *) subDataOfData: (NSData *) mainData withRange:(NSRange) range volume (CGFloat) volume { // here is the problematic line: Byte * soundWithVolumeBytes = (Byte*)malloc(range.length); Byte * mainSoundFileBytes =(Byte *)