Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTKit / QTKitServer malloc error
jamesheliker Offline
Newbie
*

Posts: 1
Joined: Mar 2011
Post: #1
Exclamation QTKit / QTKitServer malloc error
Hi All -
[/code]
I'm running in to a disturbing failure with QTKit, I have a simple command line utility that trims N number of seconds from the beginning of a QTMovie object, and then writes that QTMovie object back to disk (to a new file).

The code compiles and runs flawlessly. The executable runs exactly as intended from the command line, provided that I run less than say, 10 instances simultaneously. If additional instances are running, two errors crop up in STDERR:

Code:
QTKitServer(94967,0xb038d000) malloc: *** error for object 0xffda: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Code:
QTKitServer(95112,0xb0185000) malloc: *** error for object 0x221220: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

This utility is intended to be used with a very large corporate library of media files (all valid Quicktime mov's)
- and *anywhere from 1 to 1000 instances of the utility running at any one time is absolutely required.*

The "important code" is below:

Code:
NSNumber *yes = [NSNumber numberWithBool:YES];
NSDictionary *attrbs = [NSDictionary dictionaryWithObjectsAndKeys:
                        inputFilePath, QTMovieFileNameAttribute,
                        yes, QTMovieEditableAttribute,
                        nil];

QTMovie *movie = [[QTMovie alloc] initWithAttributes: attrbs error: nil];

long seconds = strtoull([secondsVal UTF8String], NULL, 0);
QTTime startTime = QTMakeTime(0, 1);
QTTime duration = QTMakeTime(seconds, 1);

QTTimeRange range = QTMakeTimeRange(startTime, duration);

[movie deleteSegment: range];

[NSDictionary *writeDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
                                 yes, QTMovieFlatten,
                                 nil];
[movie writeToFile: outputFilePath withAttributes: writeDictionary error: nil];

movie = nil;
[movie release];

Any help or insight would be GREATLY appreciated! Big Grin

-James Heliker
james.heliker@gmail.com
2011.03.10 01:29 AM
Find all posts by this user Quote this message in a reply
Derek Kuhl Offline
Super Moderator
******

Posts: 333
Joined: Jul 2005
Post: #2
RE: QTKit / QTKitServer malloc error
Looks like you're setting movie to nil, then releasing a pointer pointing to nil. Try commenting out the movie = nil part.
2011.04.06 01:56 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)