From b0dd44dd4788428fe92a61bca2957c6de203b13f Mon Sep 17 00:00:00 2001 From: "David G. Yu" Date: Thu, 14 May 2015 13:25:33 -0700 Subject: [PATCH] Fixed an alloca buffer overrun error in Far --- opensubdiv/far/patchTablesFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opensubdiv/far/patchTablesFactory.cpp b/opensubdiv/far/patchTablesFactory.cpp index d7bc642a..d40542ef 100644 --- a/opensubdiv/far/patchTablesFactory.cpp +++ b/opensubdiv/far/patchTablesFactory.cpp @@ -1294,7 +1294,7 @@ PatchTablesFactory::populateAdaptivePatches( int * levelFVarVertOffsets = 0; if (context.RequiresFVarPatches()) { int nchannels = refiner.GetNumFVarChannels(); - levelFVarVertOffsets = (int *)alloca(nchannels); + levelFVarVertOffsets = (int *)alloca(nchannels*sizeof(int)); memset(levelFVarVertOffsets, 0, nchannels*sizeof(int)); }