From a03463303dce5526f9439f704b28625329bde554 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 May 2001 16:11:16 +0000 Subject: [PATCH] added assertion to catch infinite loop in _tnl_fixup_compiled_cassette() - might help Keith --- src/mesa/tnl/t_imm_fixup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/tnl/t_imm_fixup.c b/src/mesa/tnl/t_imm_fixup.c index 1c3cf28..8bf0982 100644 --- a/src/mesa/tnl/t_imm_fixup.c +++ b/src/mesa/tnl/t_imm_fixup.c @@ -1,4 +1,4 @@ -/* $Id: t_imm_fixup.c,v 1.13 2001/04/30 21:08:52 keithw Exp $ */ +/* $Id: t_imm_fixup.c,v 1.14 2001/05/03 16:11:16 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -631,7 +631,9 @@ void _tnl_fixup_compiled_cassette( GLcontext *ctx, struct immediate *IM ) if (tnl->ExecParity) IM->Primitive[IM->CopyStart] |= PRIM_PARITY; - + /* one of these should be true, else we'll be in an infinite loop */ + assert(IM->PrimitiveLength[IM->Start] > 0 || + IM->Flag[IM->Start] & (VERT_END|VERT_END_VB)); for (i = IM->Start ; i <= IM->Count ; i += IM->PrimitiveLength[i]) if (IM->Flag[i] & (VERT_END|VERT_END_VB)) { IM->PrimitiveLength[IM->CopyStart] = i - IM->CopyStart; -- 2.7.4