Fix out-of-bounds read in MaterialSystem unit test
authorTuro Lamminen <turotl@gmail.com>
Thu, 14 Sep 2017 06:38:07 +0000 (09:38 +0300)
committerTuro Lamminen <turotl@gmail.com>
Mon, 2 Oct 2017 07:55:26 +0000 (10:55 +0300)
test/unit/utMaterialSystem.cpp

index f6b534f..80408db 100644 (file)
@@ -73,7 +73,7 @@ TEST_F(MaterialSystemTest, testFloatArrayProperty)
 {
     float pf[] = {0.0f,1.0f,2.0f,3.0f};
     unsigned int pMax = sizeof(pf) / sizeof(float);
-    this->pcMat->AddProperty(&pf,pMax,"testKey2");
+    this->pcMat->AddProperty(pf,pMax,"testKey2");
     pf[0] = pf[1] = pf[2] = pf[3] = 12.0f;
 
     EXPECT_EQ(AI_SUCCESS, pcMat->Get("testKey2",0,0,pf,&pMax));
@@ -97,7 +97,7 @@ TEST_F(MaterialSystemTest, testIntArrayProperty)
 {
     int pf[] = {0,1,2,3};
     unsigned int pMax = sizeof(pf) / sizeof(int);
-    this->pcMat->AddProperty(&pf,pMax,"testKey4");
+    this->pcMat->AddProperty(pf,pMax,"testKey4");
     pf[0] = pf[1] = pf[2] = pf[3] = 12;
 
     EXPECT_EQ(AI_SUCCESS, pcMat->Get("testKey4",0,0,pf,&pMax));