swscale: fix ticket #4877