[MPlayer-dev-eng] Direct3D OSD discussion

Jim Hauxwell james at dattrax.co.uk
Mon Dec 8 12:05:38 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Reimar Döffinger wrote:
> On Mon, Dec 08, 2008 at 09:14:59AM +0200, Georgi Petrov wrote:
>> I vote for inclusion now. If there are some indent / spacing issues,
>> I'll fix them after the patch is commited. We need the OSD.
> 
> Have you tested it?
> Also there is still almost the same buffer flow problem: the allocated
> texture may be smaller than the arguments to vo_draw_text, allowing for
> a buffer overflow.

Yeh, I see the issue.  I'll fix this.

> There are also minor issues like the expression to select
> non-power-of-two texture is extremely overcomplicated (e.g. !(a ^ b) is
> the same as a == b) and also wrong.
> I guess I can go over it myself and fix it when I got a bit of time.
> 

a = D3DPTEXTURECAPS_POW2
b = D3DPTEXTURECAPS_NONPOW2CONDITIONAL

a b   a ^b   !(a^b)    (a==b)
0 0   0      1         1
0 1   1      0         0
1 0   1      0         0
1 1   0      1         1

The D3D docs say the if a & b are neither defined then you assume the
device can support non power2 textures.  If they are both set then also
this is true.  If a then power2 dimensions, but possibly not square.
The other case is invalid.

I think the logic is correct, but as you said it could be simplified by
the use of (a==b)

Jim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkk8/4IACgkQhrNWoHjgI1DfcQCgqmJITjU3wpJVnMZkjz/0qsyJ
JeYAnRG1RnDcZOSwmjhaFbnZFBrd+kdx
=lOj3
-----END PGP SIGNATURE-----




More information about the MPlayer-dev-eng mailing list