mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-06 03:31:42 -04:00
fixed #18, an animation start frame number is bigger than existing file frame count, now guarded .
This commit is contained in:
parent
422019253d
commit
654e68fdbc
2 changed files with 6 additions and 0 deletions
|
@ -534,6 +534,9 @@ bool CLoading::LoadSingleFrameShape(const CString& name, int nFrame, int deltaX,
|
|||
if (!FSunPackLib::XCC_GetSHPHeader(&header)) {
|
||||
return false;
|
||||
}
|
||||
if (nFrame >= header.c_images) {
|
||||
nFrame = 0;
|
||||
}
|
||||
if (!FSunPackLib::LoadSHPImage(nFrame, 1, &pBuffer)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -922,6 +922,9 @@ namespace FSunPackLib
|
|||
if (head.cx == 0 || head.cy == 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if (startIndex >= head.c_images) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
std::vector<byte> decode_image_buffer;
|
||||
for (auto frameIdx = 0; frameIdx < wantedNum; frameIdx++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue