Fix #120857: Blender crashes for huge compositor images #120921

Merged
Omar Emara merged 1 commits from OmarEmaraDev/blender:fix-120857 into main 2024-04-23 09:44:44 +02:00

1 Commits

Author SHA1 Message Date
Omar Emara ba96a5964a Fix #120857: Blender crashes for huge compositor images
Blender crashes when the user scales up an image into huge scales. This
is due to integer overflow when doing memory allocations. So we fix this
by using larger integers when doing math on memory allocations and
indexing.

Note that while this solves the random crashes, users scaling up images
to huge scales will face things like the OOM killer activating or at
best significant slow downs due to swapping.

It is not clear how to handle such cases, but something like a global
maximum size option that is set to 16k by default might be worth adding.
2024-04-22 12:06:28 +02:00