mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0030712: Application Framework - Protect binary TriangulationDriver against empty triangulation in the file
The matter is that when the binary OCAF file contained a triangulation with 0 nodes and 0 triangles the method Paste would cause construction error of Poly_Triangulation. This patch protects this method against exception.
This commit is contained in:
parent
cca36b6b21
commit
b271edb092
@ -63,6 +63,11 @@ Standard_Boolean BinMDataXtd_TriangulationDriver::Paste(const BinObjMgt_Persiste
|
|||||||
theSource >> hasUV;
|
theSource >> hasUV;
|
||||||
theSource >> deflection;
|
theSource >> deflection;
|
||||||
|
|
||||||
|
if (!nbNodes || !nbTriangles)
|
||||||
|
{
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
// allocate the mesh
|
// allocate the mesh
|
||||||
Handle(Poly_Triangulation) PT = new Poly_Triangulation(nbNodes, nbTriangles, hasUV);
|
Handle(Poly_Triangulation) PT = new Poly_Triangulation(nbNodes, nbTriangles, hasUV);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user