From 59892dd4cc1bc29bfbc533f61fb404fb919f4906 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 30 May 2013 15:41:01 +0200 Subject: gl_common: fix invalid alignment 0 is invalid. The intention of the code turning off any additional alignment, so we need 1. Change a comment: obviously we don't try to set alignment parameters etc.to handle stride correctly, and instead do everything by row. --- video/out/gl_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/out/gl_common.c b/video/out/gl_common.c index cc3eabb712..67b373d9c3 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -830,10 +830,10 @@ mp_image_t *glGetWindowScreenshot(GL *gl) gl->GetIntegerv(GL_VIEWPORT, vp); mp_image_t *image = mp_image_alloc(IMGFMT_RGB24, vp[2], vp[3]); gl->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - gl->PixelStorei(GL_PACK_ALIGNMENT, 0); + gl->PixelStorei(GL_PACK_ALIGNMENT, 1); gl->PixelStorei(GL_PACK_ROW_LENGTH, 0); gl->ReadBuffer(GL_FRONT); - //flip image while reading + //flip image while reading (and also avoid stride-related trouble) for (int y = 0; y < vp[3]; y++) { gl->ReadPixels(vp[0], vp[1] + vp[3] - y - 1, vp[2], 1, GL_RGB, GL_UNSIGNED_BYTE, -- cgit v1.2.3