From 504f67a7596a8beab6240b52d80f3d9f3dbf1750 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Jun 2014 15:55:01 +0200 Subject: vo_opengl: fix regression with opengl:pbo In the pbo case, mpi was reassigned to a stack pointer, and later deallocated. Just change the code so it doesn't need to be reassigned. --- video/out/gl_video.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index b04fa97500..7306d33ae6 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1742,13 +1742,12 @@ void gl_video_upload_image(struct gl_video *p, struct mp_image *mpi) memcpy_pic(mpi2.planes[n], mpi->planes[n], line_bytes, mpi->plane_h[n], mpi2.stride[n], mpi->stride[n]); } - mpi = &mpi2; pbo = true; } - vimg->image_flipped = mpi->stride[0] < 0; + vimg->image_flipped = mpi2.stride[0] < 0; for (int n = 0; n < p->plane_count; n++) { struct texplane *plane = &vimg->planes[n]; - void *plane_ptr = mpi->planes[n]; + void *plane_ptr = mpi2.planes[n]; if (pbo) { gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, plane->gl_buffer); if (!gl->UnmapBuffer(GL_PIXEL_UNPACK_BUFFER)) @@ -1760,7 +1759,7 @@ void gl_video_upload_image(struct gl_video *p, struct mp_image *mpi) gl->ActiveTexture(GL_TEXTURE0 + n); gl->BindTexture(p->gl_target, plane->gl_texture); glUploadTex(gl, p->gl_target, plane->gl_format, plane->gl_type, - plane_ptr, mpi->stride[n], 0, 0, plane->w, plane->h, 0); + plane_ptr, mpi2.stride[n], 0, 0, plane->w, plane->h, 0); } gl->ActiveTexture(GL_TEXTURE0); gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); -- cgit v1.2.3