From bc97dab8860077834d3e0939cf97726366d7d4f5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 3 Oct 2012 02:50:40 +0200 Subject: [PATCH] vo_opengl: don't try to map an empty buffer The change detection signalled a full re-upload on initialization, but no texture reallocation. Binding the uninitialized buffer caused an OpenGL error. Fixes error messages on start with "opengl-hq". --- libvo/vo_opengl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvo/vo_opengl.c b/libvo/vo_opengl.c index 5c3735eebc..a9bd5f67e8 100644 --- a/libvo/vo_opengl.c +++ b/libvo/vo_opengl.c @@ -1534,7 +1534,7 @@ static void gen_eosd(struct gl_priv *p, mp_eosd_images_t *imgs) * sizeof(struct vertex) * VERTICES_PER_QUAD); - if (need_upload && p->use_pbo) { + if (need_upload && p->use_pbo && p->eosd->targets_count) { gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, p->eosd_buffer); char *data = gl->MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY); if (!data) {