[XviD-devel] [PATCH] into CVS now

Marco "elcabesa" Belli xvid-devel@xvid.org
Fri, 17 Jan 2003 16:37:36 +0100


i use not ffmpeg to look xvid encoded files, but xvid deocder=)

and i found the bug=)

int ilfe mbcoding.c at line 260 there is 

	sprite_trajectory_code[0+16384].code = 0;
	sprite_trajectory_code[0+16384].len = 0;
	for (k=0;k<14;k++)
	{
		int limit = (1<<k);

		for (l=-(2*limit-1); l <= -limit; l++)
		{
			sprite_trajectory_code[i+16384].code = (2*limit-1)+l;
			sprite_trajectory_code[i+16384].len = k+1;
		}

		for (l=limit; l<= 2*limit-1; l++)
		{
			sprite_trajectory_code[i+16384].code = l;
			sprite_trajectory_code[i+16384].len = k+1;
		}
	}

insthead of


	sprite_trajectory_code[0+16384].code = 0;
	sprite_trajectory_code[0+16384].len = 0;
	for (k=0;k<14;k++)
	{
		int limit = (1<<k);

		for (l=-(2*limit-1); l <= -limit; l++)
		{
			sprite_trajectory_code[l+16384].code = (2*limit-1)+l;
			sprite_trajectory_code[l+16384].len = k+1;
		}

		for (l=limit; l<= 2*limit-1; l++)
		{
			sprite_trajectory_code[l+16384].code = l;
			sprite_trajectory_code[l+16384].len = k+1;
		}
	}


if you cannot see the diffrence between the 2 codes , this is the diffrence

sprite_trajectory_code[i+16384].code = (2*limit-1)+l; WRONG CODE it uses i to 
address vector insthead of  l

sprite_trajectory_code[i+16384].code = (2*limit-1)+l; right code

so gmc vector were inizialided in a bad way=)

i'm testing it and it seems that there are not other error=)