st/dri: Fix crash in st/dri from dri format commit
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 23 Feb 2012 17:17:37 +0000 (18:17 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Thu, 23 Feb 2012 18:16:58 +0000 (19:16 +0100)
Introduced with 8de5c355fa2bf0f30df2c7cf39aee01e793284bf, it would probably just crash.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jesse Barnes <jbarnes@virtousgeek.org>
src/gallium/state_trackers/dri/drm/dri2.c

index cc8023d02d573c6026cf8aacbbd8e0a5f119c2ec..d0be710862bf594884105fbdc60c53c967e6fb0f 100644 (file)
@@ -440,8 +440,6 @@ dri2_create_image_from_name(__DRIscreen *_screen,
 
    tex_usage = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
 
-   img->dri_format = format;
-
    switch (format) {
    case __DRI_IMAGE_FORMAT_RGB565:
       pf = PIPE_FORMAT_B5G6R5_UNORM;
@@ -489,6 +487,7 @@ dri2_create_image_from_name(__DRIscreen *_screen,
 
    img->level = 0;
    img->layer = 0;
+   img->dri_format = format;
    img->loader_private = loaderPrivate;
 
    return img;