pos[2] is limited between 0 and 65535

fix the black screen issue for Toaru Majutsu no Index, and Toaru Kagaku no Railgun.
This commit is contained in:
oioitff 2013-02-19 19:17:15 +08:00
parent e035a1d361
commit 83b2849192

View File

@ -192,6 +192,9 @@ public:
switch (decFmt_.posfmt) {
case DEC_FLOAT_3:
memcpy(pos, data_ + decFmt_.posoff, 12);
// pos[2] is limited between 0 and 65535
if (pos[2] < 0.0 || pos[2] > 65535.0)
pos[2] = 0.0;
break;
case DEC_S16_3:
{