Mesa (master): mesa: fix _mesa_dump_textures(), add null ptr check

Brian Paul brianp at kemper.freedesktop.org
Wed Apr 22 21:12:43 UTC 2009


Module: Mesa
Branch: master
Commit: 8ee6ab6acb8f89fbc87865751573fcbffb4695ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ee6ab6acb8f89fbc87865751573fcbffb4695ef

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Apr 22 15:02:01 2009 -0600

mesa: fix _mesa_dump_textures(), add null ptr check

Calling _mesa_dump_textures() deleted the textures... oops!!!

---

 src/mesa/main/debug.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index fdd10dd..2eabcda 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -3,6 +3,7 @@
  * Version:  6.5
  *
  * Copyright (C) 1999-2005  Brian Paul   All Rights Reserved.
+ * Copyright (C) 2009  VMware, Inc.  All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -262,7 +263,7 @@ static void
 write_texture_image(struct gl_texture_object *texObj)
 {
    const struct gl_texture_image *img = texObj->Image[0][0];
-   if (img) {
+   if (img && img->Data) {
       char s[100];
 
       /* make filename */
@@ -338,5 +339,5 @@ _mesa_dump_textures(GLboolean dumpImages)
 {
    GET_CURRENT_CONTEXT(ctx);
    DumpImages = dumpImages;
-   _mesa_HashDeleteAll(ctx->Shared->TexObjects, dump_texture_cb, ctx);
+   _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx);
 }




More information about the mesa-commit mailing list