The vulnerability, as described and confirmed by the provided patch, is a classic integer overflow leading to a heap-based buffer overflow. The stack trace points directly to the WriteUHDRImage function in coders/uhdr.c. The commit ffe589df5ff8ce1433daa4ccb0d2a9fadfbe30ed addresses this issue by changing the data types of the variables used for size calculation from int to ssize_t and size_t, and by adding a pre-check to ensure the image dimensions are within safe limits before performing the multiplication. This prevents the integer overflow from occurring. The vulnerable function is therefore WriteUHDRImage, as it is the function that performs the faulty calculation and subsequent memory allocation and write operations.