Or technically, a near-null dereference.
https://bugs.freedesktop.org/show_bug.cgi?id=46303
https://bugs.freedesktop.org/show_bug.cgi?id=46739
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
if (!rb)
return;
+ /* Check if we failed to allocate the depth miptree earlier. */
+ if (buffer->attachment == __DRI_BUFFER_HIZ && rb->mt == NULL)
+ return;
+
/* If the renderbuffer's and DRIbuffer's regions match, then continue. */
if ((buffer->attachment != __DRI_BUFFER_HIZ &&
rb->mt &&
* due to failure to allocate new storage.
*/
if (buffer->attachment == __DRI_BUFFER_HIZ) {
+ assert(rb->mt);
intel_miptree_release(&rb->mt->hiz_mt);
} else {
intel_miptree_release(&rb->mt);
/* Associate buffer with new storage. */
if (buffer->attachment == __DRI_BUFFER_HIZ) {
+ assert(rb->mt);
rb->mt->hiz_mt = mt;
} else {
rb->mt = mt;