summaryrefslogtreecommitdiffstats
path: root/spudec.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-10 21:47:33 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-10 21:47:33 +0000
commit89518d1df3c398f32e9a0499e919f1feafeac849 (patch)
tree2de68a519b6d916fc457fe43021af50510ab9697 /spudec.c
parent8661c5f8c0daf23d575abdc8799be4400f01ba7c (diff)
downloadmpv-89518d1df3c398f32e9a0499e919f1feafeac849.tar.bz2
mpv-89518d1df3c398f32e9a0499e919f1feafeac849.tar.xz
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
Diffstat (limited to 'spudec.c')
-rw-r--r--spudec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/spudec.c b/spudec.c
index ce579cccda..cec9a1ab75 100644
--- a/spudec.c
+++ b/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];