[MPlayer-cvslog] r25668 - trunk/spudec.c

reimar subversion at mplayerhq.hu
Thu Jan 10 22:47:33 CET 2008


Author: reimar
Date: Thu Jan 10 22:47:33 2008
New Revision: 25668

Log:
Add an extra check to avoid a case that cause black lines in scaled
vobsubs due to an overflow in the multiplication.


Modified:
   trunk/spudec.c

Modified: trunk/spudec.c
==============================================================================
--- trunk/spudec.c	(original)
+++ trunk/spudec.c	Thu Jan 10 22:47:33 2008
@@ -731,6 +731,8 @@ static void scale_image(int x, int y, sc
   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];



More information about the MPlayer-cvslog mailing list