You appear to be leaking the IWICBitmapLock object. Also, it seems odd that you're using the buffer AND IWICBitmapLock. I assume the point of passing a buffer to BitmapImpl_Create (and wasting a bit of time/memory) was to avoid IWICBitmapLock.