vpenades / SharpGLTF

glTF reader and writer for .NET Standard
MIT License
457 stars 72 forks source link

Add out of bound check for KHR header with small images #115

Closed tragamota closed 2 years ago

tragamota commented 2 years ago

Fix for small images

I included an example image that creates a out of bounds exception

Couldn't upload webp files to github so please change the extension to .webp instead of .png

test (1)

vpenades commented 2 years ago

@tragamota could you undo the style changes and leave only the changes that are relevant to the PR? that way it will be easier for me to do a review.

tragamota commented 2 years ago

@vpenades Sorry for the style changes. Forgot to disable my autoformater.

vpenades commented 2 years ago

Merged.

On a side note... there's much to do with KHR image validation, there's still not many libraries to look for code examples... so we'll have to live with that for now.