fixed a memory overflow due to GL_PACK_ALIGNMENT not being set correctly

This commit is contained in:
myT 2017-12-12 22:08:12 +01:00
parent 21dfece12b
commit 4a296b3361
2 changed files with 8 additions and 0 deletions

View file

@ -1,6 +1,9 @@
DD Mmm 17 - 1.49
fix: taking screenshots with a render width (r_width) that wasn't a multiple of 4
would either crash or produce bad screenshots
fix: false positives of the "SCR_UpdateScreen: recursively called" fatal error
repro: connect, get kicked, connect, get kicked

View file

@ -167,6 +167,11 @@ static void GL_SetDefaultState()
qglEnable( GL_SCISSOR_TEST );
qglDisable( GL_CULL_FACE );
qglDisable( GL_BLEND );
// Needed for some of our qglReadPixels calls.
// The default alignment is 4.
// RGB with width 1366 -> not a multiple of 4!
qglPixelStorei( GL_PACK_ALIGNMENT, 1 );
}