light: Mod_Q1BSP_DecompressVis: port safety check from DecompressRow
This commit is contained in:
parent
ee5c016b57
commit
2b8f8c826d
|
|
@ -465,7 +465,13 @@ static void Mod_Q1BSP_DecompressVis(const uint8_t *in, const uint8_t *inend, uin
|
|||
return;
|
||||
}
|
||||
|
||||
for (c = *in++; c > 0; c--) {
|
||||
const int run_length = *in++;
|
||||
if (!run_length) {
|
||||
logging::print("Mod_Q1BSP_DecompressVis: 0 repeat\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (c = run_length; c > 0; c--) {
|
||||
if (out == outend) {
|
||||
logging::print("Mod_Q1BSP_DecompressVis: output overrun (decompressed {} of {} output bytes)\n",
|
||||
(out - outstart), (outend - outstart));
|
||||
|
|
|
|||
Loading…
Reference in New Issue