[XviD-devel] iA64-Patch for dev-api-4

Edouard Gomez ed.gomez at free.fr
Mon Aug 18 22:03:10 CEST 2003


Stephan Krause (s_kraste at ira.uka.de) wrote:
> > one tiny thing left thas crashes xvid on iA64 (same thing as everytimes:
> > stride is uint32_t so the whole expression is uint32_t and brakes src if
> > it is negative)
> [patch]
> 
> No one wants to commit it? If you don't patch the code you could as well 
> remove all ia64 dependent code. A segfaulting lib is not really usefull.
> 
> :-(

Just missed that email, sorry.

Commited (slightly extended, see diff below). 

2003-08-18 19:00:49 GMT Edouard Gomez <ed.gomez at free.fr>        patch-29
 
    Summary:
      64bit fix.
    Revision:
      xvidcore--devapi4--1.0--patch-29
 
    The interpolation code was unsafe on 64bit platforms, the offset was
    badly sized, resulting in segfaults.
 
    modified files:
     ./src/image/interpolate8x8.h


'-----------------------------------------
--- orig/src/image/interpolate8x8.h
+++ mod/src/image/interpolate8x8.h
@@ -156,8 +156,8 @@
 					  const uint32_t rounding)
 {
 
-	const uint8_t * const src = refn + (y + (dy>>1)) * stride + x + (dx>>1);
-	uint8_t * const dst = cur + y * stride + x;
+	const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
+	uint8_t * const dst = cur + (int)(y * stride + x);
 
 	switch (((dx & 1) << 1) + (dy & 1))	{ /* ((dx%2)?2:0)+((dy%2)?1:0) */
 	case 0:
@@ -221,7 +221,7 @@
 					  const uint32_t rounding)
 {
 
-	const uint8_t * const src = refn + (y + (dy>>1)) * stride + x + (dx>>1);
+	const uint8_t * const src = refn + (int)((y + (dy>>1)) * stride + x + (dx>>1));
 
 	switch (((dx & 1) << 1) + (dy & 1))	{ /* ((dx%2)?2:0)+((dy%2)?1:0) */
 	case 0:
'------------------------------------

-- 
Edouard Gomez


More information about the XviD-devel mailing list