nvc0: don't access array out of bounds on unexpected sample count
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 6 Aug 2013 20:20:25 +0000 (22:20 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 6 Aug 2013 20:29:33 +0000 (22:29 +0200)
src/gallium/drivers/nvc0/nvc0_context.c

index 69e1970b64e50add32b89736a9ace6430028d1eb..5da491f14e9697c0b3ada88bb42543a0a3a4f00f 100644 (file)
@@ -394,8 +394,7 @@ nvc0_context_get_sample_position(struct pipe_context *pipe,
    case 8: ptr = ms8; break;
    default:
       assert(0);
-      ptr = ms1;
-      break;
+      return; /* bad sample count -> undefined locations */
    }
    xy[0] = ptr[sample_index][0] * 0.0625f;
    xy[1] = ptr[sample_index][1] * 0.0625f;