OpenImageIO/oiio — pull request #764 by brechtvl (2013-12-23 18:35:12+00:00)
Title: Imagecache: do not abort/crash when too many error messages are accumulated

I suspect this is not the proper solution, submitting this mostly to get advice.

I got a bug report with an OSL shader like this.

shader test(string Texture = "/some/file/that/does/not/exist.png", output color Color = 0)
{
int resolution[2];

if(gettextureinfo(Texture, "resolution", resolution)){
float aspectratio = (float)resolution[1]/(float)resolution[0];
Color = texture(Texture, P[0]*aspectratio, P[1]);
}
}

This will call `TextureSystem::get_texture_info` many times, which leads to many errors reported due to the missing files, the error mesasages will exceed 16MB, and it will abort/crash. I think that there should be no crash at least, even if the user should be calling `gettextureinfo(Texture, "exists", exists)`?