Probably this is too big to allocate on the stack. 

I don't think any of the files you're handling here are all that big. It's probably easier to just use [NSData dataWithContentsOfFile:]