kplib.c: patch up negative array access, dunno how to really fix this at

the root.

git-svn-id: https://svn.eduke32.com/eduke32@2164 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-12-09 19:10:03 +00:00
parent a950232046
commit f39429fa96

View file

@ -1717,7 +1717,7 @@ static int32_t kpegrend(const char *kfilebuf, int32_t kfilength,
num = (num<<8)+((int32_t)ch); curbits += 8;
}
curbits -= daval; v = ((unsigned)num >> curbits) & pow2mask[daval];
if (v <= pow2mask[daval-1]) v -= pow2mask[daval];
if (daval>=1 /* FIXME ? */ && v <= pow2mask[daval-1]) v -= pow2mask[daval];
dcflag |= dcflagor[z];
if (!dctbuf) dc[unzig[z]] = v; else dcs[z] = (int16_t)(v<<Al);
}