Merge "bug fix check frame buffer index before copy"