[Libva] vaDisplayIsValid w/t magic number

Gwenole Beauchesne gbeauchesne at splitted-desktop.com
Fri Nov 27 04:42:41 PST 2009


Hi,

On Fri, 20 Nov 2009, Yuan, Shengquan wrote:

> There is a VA test case which passes an illegal va_dpy, e.g.
> vaMaxNumConfigAttributes(0x34534). vaDisplayIsValid check whether
> va_dpy==NULL, if not then call dpy->vaIsValid, and it will get a
> SEGFAULT
>
> We can avoid it with a stupid magic number, then every backend need
> use the same magic number:

If you want to use a magic number, I would suggest:
#define VA_DISPLAY_MAGIC 0x56414430 /* VAD0 */

Or we could add a common
vaCreateDisplay(VADisplayContextP pDisplayContext);

Then, we could move the isValidDisplay() check to libva base, by comparing 
pointers in the list.

The vaCreateDisplay() function could also be useful if a user wants to 
implement its own backend, without necessarily registering it to the 
upstream libVA project yet.

Regards,
Gwenole.


More information about the Libva mailing list