I don't know enough about bitmap processing to comment on the algorihm; that aside, the code looks good to me.
I assume the pointer from SkAutoMalloc is delete when it goes out of scope. If that's the case, you might want to consider using it for color so you don't have to worry about releasing it on the various exit points.