st/mesa: set compressed_data to NULL when freed
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 9 Jul 2020 14:59:39 +0000 (16:59 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Fri, 10 Jul 2020 07:30:26 +0000 (09:30 +0200)
Reported-by: Karol Herbst <kherbst@redhat.com>
Fixes: b6db703e0f0 ("st/mesa: make texture views inherit compressed_data storage")
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5821>

src/mesa/state_tracker/st_cb_texture.c

index 72274579187acbd764f949751d8f9ef40c3aa1da..b0ea844c0711fd140d2e6ffed9fff4e48816aa1e 100644 (file)
@@ -235,6 +235,7 @@ st_FreeTextureImageBuffer(struct gl_context *ctx,
        pipe_reference(&stImage->compressed_data->reference, NULL)) {
       free(stImage->compressed_data->ptr);
       free(stImage->compressed_data);
+      stImage->compressed_data = NULL;
    }
 
    /* if the texture image is being deallocated, the structure of the