swscale: Fix an undefined behaviour