Skip to content

Issue #6610: crashes on free select for images of certain dimensions.

Jehan requested to merge wip/Jehan/Issue-6610 into master

g_alloca() is unadvised. Even though it might be more efficient in some specific cases, it is pretty subject to stack overflow when a lot of memory is requested.

Let's allocate dynamic memory instead. To avoid doing it too much, let's just reuse the same pointer especially since region of interest will usually be the same size when iterating a buffer, except for border ones (which would usually be smaller, so we can use the same allocated buffer again). I still make size checks, just in case.

Merge request reports