Nokia-Developer-Community-Projects/wp8-sample — pull request #7 by cadahl (2014-06-03 10:10:04+00:00)
Title: Fixed allocating too large buffers, and too often.

Two fixes applied:

- The buffer length is in bytes.

- BeginProcessing may be called several times (because the block sizes can vary). It's ok if the current buffer is "large enough", so avoid recreating buffers dozens/hundreds of times per image and just keep the largest capacity seen. (Length is still a good property to track the needed size though.)