advertisement

Article:
  Bitmap Image Filters
Subject:   problem modifying filter
Date:   2003-05-27 23:22:42
From:   anonymous2
Response to: problem modifying filter

A small bug in your code is you should write:
p2 = destData + n*(y*w + w -x -1);
to calculate the p2 pointer.
This bug might result in the destData array out of bound durning the last transform operation. And if you were luck enough that there were any critical data, you application will crash.


However, I tested your code in my project. I was not so lucky to make it crash.


Maybe the real problem of yours is a bug in Mikebeam's framework. He said the object returned by filterImage: was autoreleased, and he did send a retain message to the returned object. But within the implemetation of filterImage:, the destImage was not sent such a message. A memory leakage!