This code checks rl == NULL but RE_RenderLayerGetPass assumes rl != NULL.