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:
Eric Wasylishen 2017-12-28 18:51:40 +00:00
parent ec4b6115d1
commit e4b71e6268

View file

@ -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);