2007-05-14

CGImageRelease

I haven't had time to track through this one to find out precisely what's going on, but it looks like CGImageRelease/CFRelease on a CGImage over-releases some internal CoreFoundation object. With the CFZombieLevel environment variable set to scribble released objects, the program crashes releasing a scribbled object.

This appears to occur for images created by Apple, as well as images I've created with CGImageSourceCreateImageAtIndex.

The application leaks memory if you don't release the image though, of course.

Sounds like a potential security issue to me!

update: This is fixed in 10.5.0

2007-05-11

Camel Case to Underscores and Back

To convert camelCase to underscores, in TextMate, replace ([a-z])([A-Z]) with $1_\l$2

To convert underscores to camelCase, replace ([a-z]+)_([a-z]+) with $1\u$2

2007-05-02

QuickTime 7's "Interesting" Documentation

QTVisualContextTask is documented as being "not mandatory". Apparently, "not mandatory" means "you don't have to call this, but if you don't, you will crash or kernel panic". Not quite what I would mean if I said it...

QTVisualContextCopyImageForTime is also lacking in documentation. It should also say "If you call this function more than once per video frame, QuickTime will leak a substantial amount of memory by appending to some ever-growing internal data structure". Personally, I always write functions with that kind of behavior. Users love it.