Android-x86
Fork
Faire un don

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-mesa: Commit

external/mesa


Commit MetaInfo

Révisionfbeb51d24685b614db01ed915ff1c2945389dbab (tree)
l'heure2018-02-06 17:44:06
AuteurChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Message de Log

i965: avoid possible crashing

Change Summary

Modification

--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -788,6 +788,7 @@ do_single_blorp_clear(struct brw_context *brw, struct gl_framebuffer *fb,
788788 {
789789 struct gl_context *ctx = &brw->ctx;
790790 struct intel_renderbuffer *irb = intel_renderbuffer(rb);
791+ if (!irb || !irb->mt) return false;
791792 mesa_format format = irb->mt->format;
792793 uint32_t x0, x1, y0, y1;
793794
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -386,7 +386,7 @@ brw_postdraw_set_buffers_need_resolve(struct brw_context *brw)
386386 struct intel_renderbuffer *irb =
387387 intel_renderbuffer(fb->_ColorDrawBuffers[i]);
388388
389- if (!irb)
389+ if (!irb || !irb->mt)
390390 continue;
391391
392392 brw_render_cache_set_add_bo(brw, irb->mt->bo);
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -196,6 +196,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
196196 struct gl_context *ctx = &brw->ctx;
197197 struct intel_renderbuffer *irb = intel_renderbuffer(rb);
198198 struct intel_mipmap_tree *mt = irb->mt;
199+ if (!irb || !mt) return 0;
199200
200201 if (brw->gen < 9) {
201202 assert(!(flags & INTEL_AUX_BUFFER_DISABLED));
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -157,6 +157,7 @@ intel_map_renderbuffer(struct gl_context *ctx,
157157 } else {
158158 mt = irb->mt;
159159 }
160+ if (!mt) return;
160161
161162 /* For a window-system renderbuffer, we need to flip the mapping we receive
162163 * upside-down. So we need to ask for a rectangle on flipped vertically, and
Afficher sur ancien navigateur de dépôt.