external/mesa
Revision | fbeb51d24685b614db01ed915ff1c2945389dbab (tree) |
---|---|
Time | 2018-02-06 17:44:06 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
i965: avoid possible crashing
@@ -788,6 +788,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb, | ||
788 | 788 | { |
789 | 789 | struct gl_context *ctx = &brw->ctx; |
790 | 790 | struct intel_renderbuffer *irb = intel_renderbuffer(rb); |
791 | + if (!irb || !irb->mt) return false; | |
791 | 792 | mesa_format format = irb->mt->format; |
792 | 793 | uint32_t x0, x1, y0, y1; |
793 | 794 |
@@ -386,7 +386,7 @@ brw_postdraw_set_buffers_need_resolve(struct brw_context *brw) | ||
386 | 386 | struct intel_renderbuffer *irb = |
387 | 387 | intel_renderbuffer(fb->_ColorDrawBuffers[i]); |
388 | 388 | |
389 | - if (!irb) | |
389 | + if (!irb || !irb->mt) | |
390 | 390 | continue; |
391 | 391 | |
392 | 392 | brw_render_cache_set_add_bo(brw, irb->mt->bo); |
@@ -196,6 +196,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, | ||
196 | 196 | struct gl_context *ctx = &brw->ctx; |
197 | 197 | struct intel_renderbuffer *irb = intel_renderbuffer(rb); |
198 | 198 | struct intel_mipmap_tree *mt = irb->mt; |
199 | + if (!irb || !mt) return 0; | |
199 | 200 | |
200 | 201 | if (brw->gen < 9) { |
201 | 202 | assert(!(flags & INTEL_AUX_BUFFER_DISABLED)); |
@@ -157,6 +157,7 @@ intel_map_renderbuffer(struct gl_context *ctx, | ||
157 | 157 | } else { |
158 | 158 | mt = irb->mt; |
159 | 159 | } |
160 | + if (!mt) return; | |
160 | 161 | |
161 | 162 | /* For a window-system renderbuffer, we need to flip the mapping we receive |
162 | 163 | * upside-down. So we need to ask for a rectangle on flipped vertically, and |