If rotation changed, the dequeued output buffer was never released. Move it to a finally block to avoid the leak.