memory checks for glReadPixels