• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

修訂ec0e66e57c4ee66b89a9a886f9d464da5893aac8 (tree)
時間2009-11-23 17:19:36
作者Austin Yuan <shengquan.yuan@inte...>
CommiterAustin Yuan

Log Message

Added a "magic" number to VADisplayContext in case an illeal VA dpy passed in

Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>

Change Summary

差異

--- a/src/va.c
+++ b/src/va.c
@@ -58,7 +58,7 @@ static int va_debug_trace = 0;
5858 static int vaDisplayIsValid(VADisplay dpy)
5959 {
6060 VADisplayContextP pDisplayContext = (VADisplayContextP)dpy;
61- return pDisplayContext && pDisplayContext->vaIsValid(pDisplayContext);
61+ return pDisplayContext && (pDisplayContext->vadpy_magic == 0x789abcde) && pDisplayContext->vaIsValid(pDisplayContext);
6262 }
6363
6464 static void va_errorMessage(const char *msg, ...)
--- a/src/va_backend.h
+++ b/src/va_backend.h
@@ -398,6 +398,8 @@ struct VADriverContext
398398
399399 struct VADisplayContext
400400 {
401+ int vadpy_magic;
402+
401403 VADisplayContextP pNext;
402404 VADriverContextP pDriverContext;
403405
--- a/src/x11/va_x11.c
+++ b/src/x11/va_x11.c
@@ -189,6 +189,8 @@ VADisplay vaGetDisplay (
189189 dri_state = calloc(1, sizeof(*dri_state));
190190 if (pDisplayContext && pDriverContext && dri_state)
191191 {
192+ pDisplayContext->vadpy_magic = 0x789abcde;
193+
192194 pDriverContext->x11_dpy = native_dpy;
193195 pDisplayContext->pNext = pDisplayContexts;
194196 pDisplayContext->pDriverContext = pDriverContext;