mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-03-10 03:51:41 +00:00
TexMgr_Imagedump_f: fix buffer overflow by setting GL_PACK_ALIGNMENT
reported by ASan git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1547 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
ec4b6115d1
commit
e4b71e6268
1 changed files with 2 additions and 0 deletions
|
@ -246,6 +246,8 @@ static void TexMgr_Imagedump_f (void)
|
|||
q_snprintf(tganame, sizeof(tganame), "imagedump/%s.tga", tempname);
|
||||
|
||||
GL_Bind (glt);
|
||||
glPixelStorei (GL_PACK_ALIGNMENT, 1);/* for widths that aren't a multiple of 4 */
|
||||
|
||||
if (glt->flags & TEXPREF_ALPHA)
|
||||
{
|
||||
buffer = (byte *) malloc(glt->width*glt->height*4);
|
||||
|
|
Loading…
Reference in a new issue