keeping things safe: sanity check back
authorDaniel Borca <dborca@users.sourceforge.net>
Thu, 8 Jan 2004 09:04:27 +0000 (09:04 +0000)
committerDaniel Borca <dborca@users.sourceforge.net>
Thu, 8 Jan 2004 09:04:27 +0000 (09:04 +0000)
src/mesa/tnl/t_save_api.c

index 08a5036c6d1b7d9e40709589c55ec2328263841c..8901741ffe5cbb77daeb0aed9fc4d2f86335a570 100644 (file)
@@ -440,6 +440,8 @@ static void _save_upgrade_vertex( GLcontext *ctx,
    tnl->save.vertex_size += newsz - oldsz;
    tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) / 
                        tnl->save.vertex_size);
+   if (tnl->save.counter > ctx->Const.MaxArrayLockSize )
+      tnl->save.counter = ctx->Const.MaxArrayLockSize;
    tnl->save.initial_counter = tnl->save.counter;