1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-21 10:13:43 +03:00

0029651: ViewerTest - vtexture command crashes

Missing null check added

Add test case bugs/vis/bug29651
This commit is contained in:
san 2018-03-27 11:54:12 +03:00 committed by bugmaster
parent e13b9464ef
commit 7373e19fa1
2 changed files with 22 additions and 1 deletions

View File

@ -3863,8 +3863,12 @@ Standard_Integer VTexture (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
{ {
aTextureVecNew.SetValue (aTexIndex, Handle(Graphic3d_Texture2Dmanual)()); aTextureVecNew.SetValue (aTexIndex, Handle(Graphic3d_Texture2Dmanual)());
} }
if (aTextureVecNew.Value (aTexIndex))
{
aTextureVecNew.ChangeValue(aTexIndex)->GetParams()->SetTextureUnit((Graphic3d_TextureUnit)aTexIndex); aTextureVecNew.ChangeValue(aTexIndex)->GetParams()->SetTextureUnit((Graphic3d_TextureUnit)aTexIndex);
} }
}
else else
{ {
std::cout << "Syntax error: invalid argument '" << theArgVec[anArgIter] << "'\n"; std::cout << "Syntax error: invalid argument '" << theArgVec[anArgIter] << "'\n";

17
tests/bugs/vis/bug29651 Normal file
View File

@ -0,0 +1,17 @@
puts "========"
puts "OCC29651"
puts "========"
puts ""
##########################################
# ViewerTest - vtexture command crashes
##########################################
vinit
vsetdispmode 1
box b 1 2 3
vdisplay b
vfit
vtexture b 0
vtexture b off
checkview -screenshot -3d -path ${imagedir}/${test_image}.png