airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
29.85k stars 2.85k forks source link

Increment the value of 'i' to avoid an endless loop #3014

Open RanganDas opened 11 months ago

RanganDas commented 11 months ago

I fixed a potential bug in the code where the while loop could run indefinitely. The original code missed incrementing the loop control variable 'i', causing an endless loop if the condition 'this.shapeModifiers[i].isAnimatedWithShape(data)' was never met.

I added 'i++' inside the while loop to ensure the loop eventually reaches the exit condition ('i < len') and terminates if 'isAnimatedWithShape' condition is never satisfied.