bugfix:
- fix off by one bug in render buffer setup.
- fix invalid pointer access.
- remove dead code.

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>