[Mesa-dev] [PATCH] i965: Add missing null checks in intel_mipmap_tree.c

Samuel Iglesias Gonsálvez siglesias at igalia.com
Fri Feb 19 11:19:31 UTC 2016


Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>

On Wed, Feb 17, 2016 at 05:07:00PM +0200, Juha-Pekka Heikkila wrote:
> Just check miptree_create() returned other than NULL as everywhere
> else in the file.
> 
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 6c233d8..5b0e938 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -726,6 +726,9 @@ intel_miptree_create(struct brw_context *brw,
>                                       width0, height0, depth0, num_samples,
>                                       layout_flags);
>  
> +   if (!mt)
> +      return NULL;
> +
>     /* If the BO is too large to fit in the aperture, we need to use the
>      * BLT engine to support it.  Prior to Sandybridge, the BLT paths can't
>      * handle Y-tiling, so we need to fall back to X.
> @@ -1527,6 +1530,9 @@ intel_miptree_alloc_mcs(struct brw_context *brw,
>                                 0 /* num_samples */,
>                                 mcs_flags);
>  
> +   if (!mt->mcs_mt)
> +      return false;
> +
>     intel_miptree_init_mcs(brw, mt, 0xFF);
>  
>     return mt->mcs_mt;
> -- 
> 1.9.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160219/0cf91231/attachment.sig>


More information about the mesa-dev mailing list