mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 02:09:52 +00:00
Add an extra check to avoid a case that cause black lines in scaled
vobsubs due to an overflow in the multiplication. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25668 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
8661c5f8c0
commit
89518d1df3
2
spudec.c
2
spudec.c
@ -731,6 +731,8 @@ static void scale_image(int x, int y, scale_pixel* table_x, scale_pixel* table_y
|
||||
color[2] = spu->image[base + spu->stride];
|
||||
color[3] = spu->image[base + spu->stride + 1];
|
||||
scale[0] = (table_x[x].left_up * table_y[y].left_up >> 16) * alpha[0];
|
||||
if (table_y[y].left_up == 0x10000) // necessary to avoid overflow-case
|
||||
scale[0] = table_x[x].left_up * alpha[0];
|
||||
scale[1] = (table_x[x].right_down * table_y[y].left_up >>16) * alpha[1];
|
||||
scale[2] = (table_x[x].left_up * table_y[y].right_down >> 16) * alpha[2];
|
||||
scale[3] = (table_x[x].right_down * table_y[y].right_down >> 16) * alpha[3];
|
||||
|
Loading…
Reference in New Issue
Block a user