openframeworks/openFrameworks — pull request #3428 by timscaffidi (2014-11-20 14:06:17+00:00)
Title: Bugfix 3346

As arturo pointed out, swap is the right way to do it. The reason that my previous fix actually fixed it was the call to allocate which resets some more internal variables, not because of memcpy. The real issue is that not all of the internal variables are being copied. Manually copying the pixelSize variable from the crop object to the current object stopped the error from happening. I changed the crop function to use the existing ofPixels::swap mehtod which handles swapping all of the internal variables.