nouveau : check for nmesa->state_cache.atoms overflow
authorMatthieu Castet <castet.matthieu@free.fr>
Fri, 14 Sep 2007 20:13:52 +0000 (22:13 +0200)
committerMatthieu Castet <castet.matthieu@free.fr>
Fri, 14 Sep 2007 20:13:52 +0000 (22:13 +0200)
src/mesa/drivers/dri/nouveau/nouveau_fifo.h

index 956dd549dcaa958fef12a50a4c2e99085c37d56d..08058820257cce829372d5a9d4cbf4dfe8c06d23 100644 (file)
@@ -149,6 +149,7 @@ extern void nouveau_state_cache_init(nouveauContextPtr nmesa);
 #define BEGIN_RING_CACHE(subchannel,tag,size) do {                                     \
        nmesa->state_cache.dirty=1;                                                     \
        nmesa->state_cache.current_pos=((tag)/4);                                       \
+       assert(nmesa->state_cache.current_pos + size <= NOUVEAU_STATE_CACHE_ENTRIES); \
 }while(0)
 
 #define OUT_RING_CACHE(n) do {                                                                 \