mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 06:50:11 +01:00
st/va: Check NULL pointer
Call to handle_table_get in vlVaDestroySurfaces can return NULL on failure. CID: 1243522 Signed-off-by: Gurkirpal Singh <gurkirpal204@gmail.com> Reviewed-by: Julien Isorce <j.isorce@samsung.com>
This commit is contained in:
parent
d20b89e928
commit
46dba701d8
1 changed files with 4 additions and 0 deletions
|
|
@ -71,6 +71,10 @@ vlVaDestroySurfaces(VADriverContextP ctx, VASurfaceID *surface_list, int num_sur
|
|||
pipe_mutex_lock(drv->mutex);
|
||||
for (i = 0; i < num_surfaces; ++i) {
|
||||
vlVaSurface *surf = handle_table_get(drv->htab, surface_list[i]);
|
||||
if (!surf) {
|
||||
pipe_mutex_unlock(drv->mutex);
|
||||
return VA_STATUS_ERROR_INVALID_SURFACE;
|
||||
}
|
||||
if (surf->buffer)
|
||||
surf->buffer->destroy(surf->buffer);
|
||||
util_dynarray_fini(&surf->subpics);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue