mayognaise / aframe-gif-shader

A shader to display GIF for A-Frame VR.
https://mayognaise.github.io/aframe-gif-shader/basic
MIT License
107 stars 44 forks source link

Fix for edge case when gif data is invalid #3

Closed UXVirtual closed 5 years ago

UXVirtual commented 7 years ago

Sometimes GIF data may be invalid due to incorrect encoding, corrupted transmission etc. This causes problems when attempting to call drawImage() to the canvas context. In most cases, the frame data will be undefined so we must check for this before attempting drawImage() just in case. There’s probably a more elegant way to handle this, but it seems to work for my use-case.

mayognaise commented 5 years ago

@UXVirtual i am so sorry for the late reply. thank you so much for your PR 🙏 i need to close this as the branch got conflicted. but i added your code here and added you as a contributor.