st/dri: Fix segmentation fault in sw drivers
authornobled <nobled@dreamwidth.org>
Wed, 11 Aug 2010 20:36:52 +0000 (23:36 +0300)
committerGeorge Sapountzis <gsapountzis@gmail.com>
Fri, 13 Aug 2010 19:57:26 +0000 (22:57 +0300)
src/gallium/state_trackers/dri/sw/drisw.c

index ae96f1b..249ccd7 100644 (file)
@@ -201,7 +201,7 @@ drisw_allocate_textures(struct dri_drawable *drawable,
    struct pipe_resource templ;
    unsigned width, height;
    boolean resized;
-   int i;
+   unsigned i;
 
    width  = drawable->dPriv->w;
    height = drawable->dPriv->h;
@@ -222,7 +222,7 @@ drisw_allocate_textures(struct dri_drawable *drawable,
    templ.depth0 = 1;
    templ.last_level = 0;
 
-   for (i = 0; i < ST_ATTACHMENT_COUNT; i++) {
+   for (i = 0; i < count; i++) {
       enum pipe_format format;
       unsigned bind;