On Sunday, July 16, 2017 7:31:37 AM PDT Lionel Landwerlin wrote:
> This probably can't happen, but we're better off with initialized
> variables.
> 
> CID: 1415114
> Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c 
> b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index e7ebc29b59d..83d3d8204aa 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -990,7 +990,7 @@ miptree_create_for_planar_image(struct brw_context *brw,
>                                  __DRIimage *image, GLenum target)
>  {
>     struct intel_image_format *f = image->planar_format;
> -   struct intel_mipmap_tree *planar_mt;
> +   struct intel_mipmap_tree *planar_mt = NULL;
>  
>     for (int i = 0; i < f->nplanes; i++) {
>        const int index = f->planes[i].buffer_index;
> 

Yep, can't happen, the caller checks that f->planes > 0 and the loop
initializes it to one value or the other.  But it's probably best to
return NULL if somebody ever did call it with f->planes == 0, rather
than uninitialized junk, and this is cheap, so...

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to