I'm working on my stb_image wrapper right now. It's almost ready for release. 
But to be a good little developer I want to test it on the three major 
platforms (Linux, OS X, and Windows) before saying it's v1.0.

I developed it on Linux and it passes all of the unit tests. But when I tried 
to have it run on OS X (sierra), I got this error:
    
    
    [Suite] Unit Tests for stb_image wrapper
    Traceback (most recent call last)
    tests.nim(56)            tests
    stb_image.nim(86)        load
    SIGSEGV: Illegal storage access. (Attempt to read from nil?)
    

The line in question can be found here: 
[https://gitlab.com/define-private-public/stb_image-Nim/blob/bd4fc301069b068d7657b838ecf369be0573683a/stb_image.nim#L86](https://gitlab.com/define-private-public/stb_image-Nim/blob/bd4fc301069b068d7657b838ecf369be0573683a/stb_image.nim#L86)

I did a little investigating. The wrapped function stbi_load() is setting the 
width, height, and components variables like it should, but nothing is being 
passed into data upon the function's return. I got the same error when I tried 
to do this:
    
    
    echo data[]
    

I really have no idea what is wrong.

Reply via email to