[XviD-devel] [BUG] Stable - Fix probably needed in unstable too

Edouard Gomez xvid-devel@xvid.org
Fri, 20 Dec 2002 00:07:11 +0100


--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I received 2 mails last week reporting me this bug. They got lost in my
"per month automatic" backup. The bug is quite simple, vlc_init is
supposed to initialise arrays of 64*2048*2 =3D=3D 524288 elements but
intra_table and inter_table are only 524032 (? why that value ?)

I don't know why but this bug was not detected by neither valgrind on
GNU/linux nor Purify on Win32 platforms when declared as global arrays.
We already spoted that bug when declaring theese arrays as static but
only on Win32. We thought it was MSVC compiler mistake and switched back
to global arrays.

But of course this was wrong fix. The right one follows, please apply to
dev-api-3 if the code has not changed yet (skal's version?):

<patch>
diff -u -r1.34 src/bitstream/mbcoding.c
--- mbcoding.c 26 Nov 2002 23:44:10 -0000	1.34
+++ mbcoding.c 19 Dec 2002 22:58:26 -0000
@@ -71,8 +71,8 @@
  *************************************************************************=
***/
=20
 /* msvc sp5+pp gets confused if they globals are made static */
-VLC intra_table[524032];
-VLC inter_table[524032];
+static VLC intra_table[524288];
+static VLC inter_table[524288];
=20
 static VLC DCT3Dintra[4096];
 static VLC DCT3Dinter[4096];
</patch>

Thanks go to the 2 persons who told me we were wrong.

--=20
Edouard Gomez

--OXfL5xGRrasGEqWY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+AlEfR5dTYz5sWMcRAmrDAJ47X/KhR6CokeIuOS0aLc1BzSmicgCdFkxx
zknp4DKEnJX8bc8k0n4MQUE=
=lWbe
-----END PGP SIGNATURE-----

--OXfL5xGRrasGEqWY--