From d0ae3298e14fe554ce21abf20377fa0d6d4ea64e Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sat, 25 Oct 2014 01:51:03 +0100 Subject: [PATCH] check for frame before applying selection --- source/app/PropertiesSidebar.cpp | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/source/app/PropertiesSidebar.cpp b/source/app/PropertiesSidebar.cpp index 1344f87..69d7a03 100644 --- a/source/app/PropertiesSidebar.cpp +++ b/source/app/PropertiesSidebar.cpp @@ -491,22 +491,25 @@ Void FramePropertiesSideBar::setSelection( const QRect &selectionArea ) // This is necessary to stop computation because image.bits() is // currently used by threaded histogram algorithm. - m_cSelectionArea = selectionArea; + if( m_pcFrame ) + { + m_cSelectionArea = selectionArea; - if( selectionArea.isValid() ) - { - histogramWidget->stopHistogramComputation(); - histogramWidget->updateSelectionData( new PlaYUVerFrame(m_pcFrame, selectionArea)); - fullImageButton->show(); - selectionImageButton->show(); - selectionImageButton->click(); - slotRenderingChanged( HistogramWidget::ImageSelectionHistogram ); - } - else - { - fullImageButton->hide(); - selectionImageButton->hide(); - slotRenderingChanged( HistogramWidget::FullImageHistogram ); + if( selectionArea.isValid() ) + { + histogramWidget->stopHistogramComputation(); + histogramWidget->updateSelectionData( new PlaYUVerFrame(m_pcFrame, selectionArea)); + fullImageButton->show(); + selectionImageButton->show(); + selectionImageButton->click(); + slotRenderingChanged( HistogramWidget::ImageSelectionHistogram ); + } + else + { + fullImageButton->hide(); + selectionImageButton->hide(); + slotRenderingChanged( HistogramWidget::FullImageHistogram ); + } } }