ImageEngine/gaffer — pull request #1085 by davidsminor (2014-11-14 20:17:56+00:00)
Title: Preventing OIIO error overflow crash

ImageView::enabled() checks for valid files using ImageCache::imagespec(), which appends to an error message buffer when it encounters an invalid file. The function gets called by the hash() method, and therefore gets called loads of times, meaning a lot of errors can get added to the buffer very quickly in some situations. If the error buffer exceeds 16mb in size, this triggers an assertion failure, which can crash the application. I've prevented this by calling ImageCache::geterror() on failure so the buffer gets cleared.