caopengllayer: don't pass invalid pics to the OpenGL context