radeon: check for valid bo in release arrays
authorDave Airlie <airlied@redhat.com>
Sat, 14 Feb 2009 02:01:54 +0000 (12:01 +1000)
committerDave Airlie <airlied@redhat.com>
Sat, 14 Feb 2009 02:05:36 +0000 (12:05 +1000)
src/mesa/drivers/dri/radeon/radeon_maos_verts.c

index bb90a7b1117259a891be36d71ed8b7a6f6ddf1d1..d468a97200620a5bf8f5daebd4caeb257744f50f 100644 (file)
@@ -438,7 +438,9 @@ void radeonReleaseArrays( GLcontext *ctx, GLuint newinputs )
    int i;
 
    for (i = 0; i < rmesa->tcl.nr_aos_components; i++) {
-     radeon_bo_unref(rmesa->tcl.aos[i].bo);
-     rmesa->tcl.aos[i].bo = NULL;
+      if (rmesa->tcl.aos[i].bo) {
+         radeon_bo_unref(rmesa->tcl.aos[i].bo);
+         rmesa->tcl.aos[i].bo = NULL;
+      }
    }
 }