Don't call GetBuffer() twice
Merge pull request #1539 from xt0rted/patch-2

Don't call GetBuffer() twice