mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
menu_animation: Fix a guard against realloc
This commit is contained in:
parent
98c5e466a7
commit
73b9452a16
@ -31,10 +31,14 @@ void add_tween(float duration, float target_value, float* subject,
|
||||
easingFunc easing, tweenCallback callback)
|
||||
{
|
||||
tween_t *tween = NULL;
|
||||
tweens = (tween_t*)
|
||||
tween_t *temp_tweens = (tween_t*)
|
||||
realloc(tweens, (numtweens + 1) * sizeof(tween_t));
|
||||
|
||||
if (!tweens) /* Realloc failed. */
|
||||
if (temp_tweens)
|
||||
{
|
||||
tweens = temp_tweens;
|
||||
}
|
||||
else /* Realloc failed. */
|
||||
{
|
||||
tween_free(tweens);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user