Re: [Mesa-dev] [PATCH mesa] mesa: add missing return in error path

2018-06-18 Thread Iago Toral
Reviewed-by: Iago Toral Quiroga 

On Mon, 2018-06-18 at 11:40 +0100, Eric Engestrom wrote:
> Fixes: 67f40dadaadacd90 "mesa: add support for
> ARB_sample_locations"
> Cc: Rhys Perry 
> Cc: Brian Paul 
> Signed-off-by: Eric Engestrom 
> ---
>  src/mesa/main/fbobject.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index 5d7e5d29847dcfdbb23e..fa7a9361dfcfeaa105aa 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -4695,9 +4695,11 @@ sample_locations(struct gl_context *ctx,
> struct gl_framebuffer *fb,
> if (!fb->SampleLocationTable) {
>size_t size = MAX_SAMPLE_LOCATION_TABLE_SIZE * 2 *
> sizeof(GLfloat);
>fb->SampleLocationTable = malloc(size);
> -  if (!fb->SampleLocationTable)
> +  if (!fb->SampleLocationTable) {
>   _mesa_error(ctx, GL_OUT_OF_MEMORY,
>   "Cannot allocate sample location table");
> + return;
> +  }
>for (i = 0; i < MAX_SAMPLE_LOCATION_TABLE_SIZE * 2; i++)
>   fb->SampleLocationTable[i] = 0.5f;
> }
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH mesa] mesa: add missing return in error path

2018-06-18 Thread Eric Engestrom
Fixes: 67f40dadaadacd90 "mesa: add support for ARB_sample_locations"
Cc: Rhys Perry 
Cc: Brian Paul 
Signed-off-by: Eric Engestrom 
---
 src/mesa/main/fbobject.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 5d7e5d29847dcfdbb23e..fa7a9361dfcfeaa105aa 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -4695,9 +4695,11 @@ sample_locations(struct gl_context *ctx, struct 
gl_framebuffer *fb,
if (!fb->SampleLocationTable) {
   size_t size = MAX_SAMPLE_LOCATION_TABLE_SIZE * 2 * sizeof(GLfloat);
   fb->SampleLocationTable = malloc(size);
-  if (!fb->SampleLocationTable)
+  if (!fb->SampleLocationTable) {
  _mesa_error(ctx, GL_OUT_OF_MEMORY,
  "Cannot allocate sample location table");
+ return;
+  }
   for (i = 0; i < MAX_SAMPLE_LOCATION_TABLE_SIZE * 2; i++)
  fb->SampleLocationTable[i] = 0.5f;
}
-- 
Cheers,
  Eric

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev