Fix: Use higher default OIIO file size limit

Increase the default OIIO limit for uncompressed image buffers. Without
this Cycles could, among some other operations, encounter the following
type of error:
```
E0307 19:21:38.489921  2588 tile.cpp:634] Error opening tile file t:\temp\blender_a26776\cycles-tile-buffer-34740-2157603138768-0-0.exr
OpenImageIO exited with a pending error message that was never
retrieved via OIIO::geterror(). This was the error message:
Uncompressed image size 33645.6 MB exceeds the 32768 MB limit.
Image claimed to be 42000x42000, 5-channel float. Possible corrupt input?
If this is a valid file, raise the OIIO attribute "limits:imagesize_MB".
```

Users are able to bypass this themselves in two different ways if
the limit does not meet their needs.

The primary downside of this change is that it increases the memory
consumed if the file is actually malicious. Perhaps well beyond what
most consumer devices have available with physical+swap.

An alternate design would be to expose a System-level preference
for this limit and keep the default 32gb.

Refer to: #135648

Pull Request: https://projects.blender.org/blender/blender/pulls/135676
This commit is contained in:
Jesse Yurkovich
2025-03-10 22:01:03 +01:00
committed by Jesse Yurkovich
parent 5ea6ffef68
commit 3fe61d1b22

View File

@@ -26,6 +26,11 @@ void OIIO_init()
/* As of OpenEXR 3.2.1 there are still issues related to the use of OpenEXR Core. */
OIIO::attribute("openexr:core", 0);
/* Allow OpenImageIO to open files up to the size specified. An 80gb limit
* will allow a 4-gigapixel, 5-channel, image to be opened (e.g. like what
* would be encountered with the Cycles "tile" buffer file). */
OIIO::attribute("limits:imagesize_MB", 80 * 1024);
}
int OIIO_getVersionHex()