diff options
author | Austin Yuan <shengquan.yuan@intel.com> | 2014-02-27 15:36:17 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2014-09-09 01:16:43 +0800 |
commit | 5d4faa102b49ef6dbf8a1fcd04a82a8c04030e6a (patch) | |
tree | 93d20b8e683da8880f6afab91570179da03bade0 /va/va_fool.c | |
parent | 3b656e4063b484fa1d76e539c39454a119548ed8 (diff) | |
download | libva-5d4faa102b49ef6dbf8a1fcd04a82a8c04030e6a.tar.gz |
vafool: fix the vaMapBuffer for the buffer from vaDeriveImage
It is not desired to run into FOOL path for the vaMapBuffer
from vaDeriveImage
Signed-off-by: Austin Yuan <shengquan.yuan@intel.com>
(cherry picked from commit 2896166fefa36772ea6946ebc5df85024928dd6c)
Diffstat (limited to 'va/va_fool.c')
-rw-r--r-- | va/va_fool.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/va/va_fool.c b/va/va_fool.c index 95d1880..9f7a045 100644 --- a/va/va_fool.c +++ b/va/va_fool.c @@ -252,8 +252,14 @@ VAStatus va_FoolBufferInfo( unsigned int *num_elements /* out */ ) { + unsigned int magic; + DPY2FOOLCTX_CHK(dpy); + magic = buf_id & FOOL_BUFID_MASK; + if (magic != FOOL_BUFID_MAGIC) + return 0; /* could be VAImageBufferType from vaDeriveImage */ + *type = buf_id & 0xff; *size = fool_ctx->fool_buf_size[*type]; *num_elements = fool_ctx->fool_buf_element[*type];; @@ -342,9 +348,13 @@ VAStatus va_FoolMapBuffer( void **pbuf /* out */ ) { - unsigned int buftype; + unsigned int magic, buftype; DPY2FOOLCTX_CHK(dpy); + magic = buf_id & FOOL_BUFID_MASK; + if (magic != FOOL_BUFID_MAGIC) + return 0; /* could be VAImageBufferType from vaDeriveImage */ + buftype = buf_id & 0xff; *pbuf = fool_ctx->fool_buf[buftype]; |