[Mesa-dev] [PATCH 11/11] glsl: check _mesa_hash_table_create return value in link_uniform_blocks
Ian Romanick
idr at freedesktop.org
Fri Apr 4 13:32:41 PDT 2014
On 04/04/2014 03:28 AM, Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
> src/glsl/link_uniform_blocks.cpp | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/glsl/link_uniform_blocks.cpp b/src/glsl/link_uniform_blocks.cpp
> index 72d6c53..8f10a97 100644
> --- a/src/glsl/link_uniform_blocks.cpp
> +++ b/src/glsl/link_uniform_blocks.cpp
> @@ -170,6 +170,15 @@ link_uniform_blocks(void *mem_ctx,
> struct hash_table *block_hash =
> _mesa_hash_table_create(mem_ctx, _mesa_key_string_equal);
>
> + if (block_hash == NULL)
> + {
if (block_hash == NULL) {
> + /* _mesa_hash_table_create return NULL when it could not allocate
> + * memory.
> + */
I don't think this comment is necessary.
> + _mesa_error_no_memory(__FUNCTION__);
And the previously mentioned __func__ issue.
> + return 0;
> + }
> +
> /* Determine which uniform blocks are active.
> */
> link_uniform_block_active_visitor v(mem_ctx, block_hash, prog);
>
More information about the mesa-dev
mailing list