hardware/intel/libva
修訂 | ec0e66e57c4ee66b89a9a886f9d464da5893aac8 (tree) |
---|---|
時間 | 2009-11-23 17:19:36 |
作者 | Austin Yuan <shengquan.yuan@inte...> |
Commiter | Austin Yuan |
Added a "magic" number to VADisplayContext in case an illeal VA dpy passed in
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
@@ -58,7 +58,7 @@ static int va_debug_trace = 0; | ||
58 | 58 | static int vaDisplayIsValid(VADisplay dpy) |
59 | 59 | { |
60 | 60 | VADisplayContextP pDisplayContext = (VADisplayContextP)dpy; |
61 | - return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext); | |
61 | + return pDisplayContext && (pDisplayContext->vadpy_magic == 0x789abcde) && pDisplayContext->vaIsValid(pDisplayContext); | |
62 | 62 | } |
63 | 63 | |
64 | 64 | static void va_errorMessage(const char *msg, ...) |
@@ -398,6 +398,8 @@ struct VADriverContext | ||
398 | 398 | |
399 | 399 | struct VADisplayContext |
400 | 400 | { |
401 | + int vadpy_magic; | |
402 | + | |
401 | 403 | VADisplayContextP pNext; |
402 | 404 | VADriverContextP pDriverContext; |
403 | 405 |
@@ -189,6 +189,8 @@ VADisplay vaGetDisplay ( | ||
189 | 189 | dri_state = calloc(1, sizeof(*dri_state)); |
190 | 190 | if (pDisplayContext && pDriverContext && dri_state) |
191 | 191 | { |
192 | + pDisplayContext->vadpy_magic = 0x789abcde; | |
193 | + | |
192 | 194 | pDriverContext->x11_dpy = native_dpy; |
193 | 195 | pDisplayContext->pNext = pDisplayContexts; |
194 | 196 | pDisplayContext->pDriverContext = pDriverContext; |