Skip to content

vulkan/gpu_buf: avoid segfault with unusually aligned size_base

Leo Izen requested to merge Traneptora/libplacebo:xfer-segv into master

This patch prevents a segmentation fault that occurs when size_base is not a multiple of max_transfer. If size_base is larger than the max_transfer value but is not a multiple of it, the last iteration of the loop will transfer too much. It needs to transfer how much is remaining of size_base.

Note that the PL_MIN behaves identically when size_base is less than max_transfer, because xfer will never be nonzero in that scenario.

Signed-off-by: Leo Izen leo.izen@gmail.com

Merge request reports

Loading