diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index b0e8c4c..2359a36 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1146,7 +1146,8 @@ driValidateTextureHeaps( driTexHeap * const * texture_heaps, unsigned textures_in_heap = 0; unsigned blocks_in_mempool = 0; const driTexHeap * heap = texture_heaps[i]; - const struct mem_block *p = heap->memory_heap; + const struct mem_block *memory_heap = heap->memory_heap; + const struct mem_block *p = memory_heap->next; /* Check each texture object has a MemBlock, and is linked into * the correct heap. @@ -1183,7 +1184,7 @@ driValidateTextureHeaps( driTexHeap * const * texture_heaps, * - Bounds */ - while ( p != NULL ) { + while ( p != memory_heap ) { if (p->reserved) { fprintf( stderr, "%s: Block (%08x,%x), is reserved?!\n", __FUNCTION__, p->ofs, p->size );