origamilabs/OGImage — pull request #21 by artgillespie (2013-03-08 22:41:02+00:00)
Title: [FIXES #7] fixes mysterious crasher.

When scaling using aspect fill, if an image needed to be offset in order to center on the x-axis (because the image is taller than wide) there was occasionally a crash deep in memcpy. This happens because of the way a CGImageContext creates an image whose width doesn't correspond to its rowBytes—a buffer overrun can happen. By reducing the height by 1-pixel in this situation, we avoid the buffer overrun.