Hi,

I’ve got an interesting crash here that I can see *why* it occurs in the OIIO 
codebase, but is it down to misuse or a corner-case crash?

So, I’m using the texture system sampling via the texture(…) call.
The image is mipmapped, and the level it’s decided to sample from is mipmap 
level 9 (the highest) so presents a ImageSpec with a width/height of 1 pixel.

Sampling options are set to Smart Periodic, and within this is calls down to 
sample_bicubic (because of the near-side-on view of the texture applied to a 
flat quad - the derivatives are 34.0/0.1 and 66.4/0.2).
Down here the code then goes into the SIMD implementation of periodic shared 
border (wrap_periodic_sharedborder_simd call)

Now, because the width passed in is 1, the modulus operator is given a value of 
0, and hence the crash.

coord = coord % (width-1);   <— width is 1, so you get a coord = coord % 0 and 
crash.

As it happens, we should be using the clamp wrapping mode, but the crash would 
still hold for the scenario outlined above.
But is this misuse or a valid issue?

I’m using OIIO 1.7.10, Windows, VS2015 compiler.

Best Regards,
   Simon

---
Simon C Smith
Co-Founder & CTO
www.lightmap.co.uk

Email confidentiality notice:
This message is private and confidential. If you have received this message in 
error, please notify us and remove it from your system.

_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to