Commit 09beb29
committed
engine: common: mod_studio: fix model traversal and crash in Mod_StudioComputeBounds
Mod_StudioComputeBounds incorrectly assumed that all models across all body parts were laid out contiguously in memory. This caused out-of-bounds reads or reading garbage data when loading complex models, leading to crashes.
Also fixed R_StudioCalcBones call to pass the animation data pointer for the current bone (&panim[j]) instead of always using the first bone's data. This ensures animation bounding boxes are calculated correctly for each bone.1 parent 9554805 commit 09beb29
1 file changed
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
694 | 693 | | |
695 | 694 | | |
696 | 695 | | |
| |||
706 | 705 | | |
707 | 706 | | |
708 | 707 | | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | 708 | | |
717 | | - | |
| 709 | + | |
718 | 710 | | |
719 | | - | |
720 | | - | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
721 | 718 | | |
722 | 719 | | |
723 | 720 | | |
| |||
736 | 733 | | |
737 | 734 | | |
738 | 735 | | |
739 | | - | |
| 736 | + | |
740 | 737 | | |
741 | 738 | | |
742 | 739 | | |
| |||
0 commit comments