mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-03 18:38:11 +02:00
st/va: add more errors checks in vlVaBufferSetNumElements and vlVaMapBuffer
Signed-off-by: Julien Isorce <j.isorce@samsung.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
86eb4131a9
commit
5e763aaa21
1 changed files with 6 additions and 0 deletions
|
|
@ -73,6 +73,9 @@ vlVaBufferSetNumElements(VADriverContextP ctx, VABufferID buf_id,
|
|||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
||||
buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, buf_id);
|
||||
if (!buf)
|
||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||
|
||||
buf->data = REALLOC(buf->data, buf->size * buf->num_elements,
|
||||
buf->size * num_elements);
|
||||
buf->num_elements = num_elements;
|
||||
|
|
@ -91,6 +94,9 @@ vlVaMapBuffer(VADriverContextP ctx, VABufferID buf_id, void **pbuff)
|
|||
if (!ctx)
|
||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||
|
||||
if (!pbuff)
|
||||
return VA_STATUS_ERROR_INVALID_PARAMETER;
|
||||
|
||||
buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, buf_id);
|
||||
if (!buf)
|
||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue