From 537113149497b41c378291dbf9706ea27d2a9b44 Mon Sep 17 00:00:00 2001 From: ika Date: Fri, 6 Nov 2015 11:47:53 +0300 Subject: [PATCH] 0026451: Crash importing STeP file Add check for NULL. --- src/STEPConstruct/STEPConstruct_Styles.cxx | 2 ++ src/StepVisual/StepVisual_FillAreaStyle.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/STEPConstruct/STEPConstruct_Styles.cxx b/src/STEPConstruct/STEPConstruct_Styles.cxx index 4dfe51c818..ad131f96c0 100644 --- a/src/STEPConstruct/STEPConstruct_Styles.cxx +++ b/src/STEPConstruct/STEPConstruct_Styles.cxx @@ -575,6 +575,8 @@ Standard_Boolean STEPConstruct_Styles::GetColors (const Handle(StepVisual_Styled Handle(StepVisual_SurfaceStyleFillArea) SSFA = SSES.SurfaceStyleFillArea(); if ( !SSFA.IsNull() ) { Handle(StepVisual_FillAreaStyle) FAS = SSFA->FillArea(); + if (FAS.IsNull()) + continue; for ( Standard_Integer m=1; m <= FAS->NbFillStyles(); m++ ) { StepVisual_FillStyleSelect FSS = FAS->FillStylesValue ( m ); Handle(StepVisual_FillAreaStyleColour) FASC = FSS.FillAreaStyleColour(); diff --git a/src/StepVisual/StepVisual_FillAreaStyle.cxx b/src/StepVisual/StepVisual_FillAreaStyle.cxx index fea1068635..43d5391301 100644 --- a/src/StepVisual/StepVisual_FillAreaStyle.cxx +++ b/src/StepVisual/StepVisual_FillAreaStyle.cxx @@ -56,5 +56,5 @@ StepVisual_FillStyleSelect StepVisual_FillAreaStyle::FillStylesValue(const Stand Standard_Integer StepVisual_FillAreaStyle::NbFillStyles () const { - return fillStyles->Length(); + return (fillStyles.IsNull() ? 0 : fillStyles->Length()); }