matt-way / gifuct-js

Fastest javascript .GIF decoder/parser
MIT License
441 stars 63 forks source link

demo/index.html Out of Memory #25

Closed 3400442579 closed 3 years ago

3400442579 commented 3 years ago

错误代码: Out of Memory

bug

matt-way commented 3 years ago

So I've dug into this GIF, and the problem is that the actual file is corrupted. The last frame just cuts off. However it shouldn't result in an out of mem. The reason this happens is that inside the subblock parser, it is looking for a terminating character which it never receives. The fix I can add is to ensure that the subblocks never read past the end of the stream (in case a terminator is never hit).

matt-way commented 3 years ago

Ok, I've pushed a new version that should be able to deal with corrupted gifs in a much nicer way (if the corruption is in the subblocks).