[iqm] Check frames before freeing its buffer

Fixes a segfault on shutdown when the iqm model has no animation data.
This commit is contained in:
Bill Currie 2023-09-04 11:01:46 +09:00
parent 23b041c2c0
commit 2b5b55f416

View file

@ -533,8 +533,10 @@ Mod_FreeIQM (iqm_t *iqm)
free (iqm->baseframe);
free (iqm->inverse_baseframe);
free (iqm->anims);
if (iqm->frames) {
free (iqm->frames[0]);
free (iqm->frames);
}
free (iqm);
}