From c755d75a5eb902582020ea0bb096be3e5e684ef2 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 25 Mar 2015 15:28:54 -0500 Subject: [PATCH] Fix MDR surface indexes overflow check Also, use the check overflow macro like everywhere else. --- code/renderergl1/tr_animation.c | 2 +- code/renderergl2/tr_animation.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/renderergl1/tr_animation.c b/code/renderergl1/tr_animation.c index 7bcc5bdf..b01cf813 100644 --- a/code/renderergl1/tr_animation.c +++ b/code/renderergl1/tr_animation.c @@ -346,7 +346,7 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface ) oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + backEnd.currentEntity->e.oldframe * frameSize ); - RB_CheckOverflow( surface->numVerts, surface->numTriangles ); + RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); triangles = (int *) ((byte *)surface + surface->ofsTriangles); indexes = surface->numTriangles * 3; diff --git a/code/renderergl2/tr_animation.c b/code/renderergl2/tr_animation.c index 74226752..53e5ee99 100644 --- a/code/renderergl2/tr_animation.c +++ b/code/renderergl2/tr_animation.c @@ -350,7 +350,7 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface ) oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + backEnd.currentEntity->e.oldframe * frameSize ); - RB_CheckOverflow( surface->numVerts, surface->numTriangles ); + RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); triangles = (int *) ((byte *)surface + surface->ofsTriangles); indexes = surface->numTriangles * 3;