Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
a8b2683b
Commit
a8b2683b
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Fix potential crash in animation parsing
parent
d1573cb5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcharacter/llkeyframemotion.cpp
+5
-8
5 additions, 8 deletions
indra/llcharacter/llkeyframemotion.cpp
with
5 additions
and
8 deletions
indra/llcharacter/llkeyframemotion.cpp
+
5
−
8
View file @
a8b2683b
...
@@ -2132,30 +2132,27 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
...
@@ -2132,30 +2132,27 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid,
}
}
S32
size
=
file
.
getSize
();
S32
size
=
file
.
getSize
();
U8
*
buffer
=
new
U8
[
size
];
std
::
unique_ptr
<
U8
[]
>
buffer
(
new
U8
[
size
]
)
;
if
(
!
file
.
read
((
U8
*
)
buffer
,
size
))
/*Flawfinder: ignore*/
if
(
!
file
.
read
((
U8
*
)
buffer
.
get
()
,
size
))
/*Flawfinder: ignore*/
{
{
delete
[]
buffer
;
LL_WARNS
()
<<
"Failed to load asset for animation from cache "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
LL_ENDL
;
LL_WARNS
()
<<
"Failed to load asset for animation from cache "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
LL_ENDL
;
motionp
->
mAssetStatus
=
ASSET_FETCH_FAILED
;
motionp
->
mAssetStatus
=
ASSET_FETCH_FAILED
;
return
;
return
;
}
}
LL_DEBUGS
(
"Animation"
)
<<
"Loading keyframe data for: "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
" ("
<<
size
<<
" bytes)"
<<
LL_ENDL
;
LL_DEBUGS
(
"Animation"
)
<<
"Loading keyframe data for: "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
" ("
<<
size
<<
" bytes)"
<<
LL_ENDL
;
LLDataPackerBinaryBuffer
dp
(
buffer
,
size
);
LLDataPackerBinaryBuffer
dp
(
buffer
.
get
()
,
size
);
if
(
motionp
->
deserialize
(
dp
,
asset_uuid
))
if
(
motionp
->
deserialize
(
dp
,
asset_uuid
))
{
{
motionp
->
mAssetStatus
=
ASSET_LOADED
;
motionp
->
mAssetStatus
=
ASSET_LOADED
;
}
}
else
else
{
{
delete
[]
buffer
;
LL_WARNS
()
<<
"Failed to decode asset for animation "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
LL_ENDL
;
LL_WARNS
()
<<
"Failed to decode asset for animation "
<<
motionp
->
getName
()
<<
":"
<<
motionp
->
getID
()
<<
LL_ENDL
;
motionp
->
mAssetStatus
=
ASSET_FETCH_FAILED
;
motionp
->
mAssetStatus
=
ASSET_FETCH_FAILED
;
return
;
}
}
delete
[]
buffer
;
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment