Coverity issue fixes.
Fix Coverity issues 157138, 338547, and 338716.
This commit is contained in:
parent
a2c28b18a8
commit
3b16c38756
|
@ -1251,6 +1251,7 @@ CAIRO_GAL::CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
|
|||
m_mainBuffer = 0;
|
||||
m_overlayBuffer = 0;
|
||||
m_tempBuffer = 0;
|
||||
m_savedBuffer = 0;
|
||||
m_validCompositor = false;
|
||||
SetTarget( TARGET_NONCACHED );
|
||||
|
||||
|
@ -1324,7 +1325,6 @@ void CAIRO_GAL::endDrawing()
|
|||
|
||||
// Now translate the raw context data from the format stored
|
||||
// by cairo into a format understood by wxImage.
|
||||
|
||||
pixman_image_t* dstImg = pixman_image_create_bits(
|
||||
wxPlatformInfo::Get().GetEndianness() == wxENDIAN_LITTLE ? PIXMAN_b8g8r8
|
||||
: PIXMAN_r8g8b8,
|
||||
|
@ -1644,7 +1644,6 @@ void CAIRO_GAL_BASE::DrawGrid()
|
|||
int gridEndY = KiROUND( ( worldEndPoint.y - m_gridOrigin.y ) / gridScreenSize.y );
|
||||
|
||||
// Ensure start coordinate > end coordinate
|
||||
|
||||
SWAP( gridStartX, >, gridEndX );
|
||||
SWAP( gridStartY, >, gridEndY );
|
||||
|
||||
|
@ -1691,6 +1690,7 @@ void CAIRO_GAL_BASE::DrawGrid()
|
|||
{
|
||||
m_lineWidthIsOdd = true;
|
||||
m_isStrokeEnabled = true;
|
||||
|
||||
for( int j = gridStartY; j <= gridEndY; j++ )
|
||||
{
|
||||
bool tickY = ( j % m_gridTick == 0 );
|
||||
|
|
|
@ -435,7 +435,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem
|
|||
}
|
||||
}
|
||||
|
||||
if( zoneTree->QueryColliding( itemBBox, itemShape.get(), aLayer,
|
||||
if( zoneTree && zoneTree->QueryColliding( itemBBox, itemShape.get(), aLayer,
|
||||
std::max( 0, clearance - m_drcEpsilon ),
|
||||
&actual, &pos ) )
|
||||
{
|
||||
|
@ -480,7 +480,7 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZones( BOARD_ITEM* aItem
|
|||
aLayer );
|
||||
clearance = constraint.GetValue().Min();
|
||||
|
||||
if( zoneTree->QueryColliding( itemBBox, holeShape.get(), aLayer,
|
||||
if( zoneTree && zoneTree->QueryColliding( itemBBox, holeShape.get(), aLayer,
|
||||
std::max( 0, clearance - m_drcEpsilon ),
|
||||
&actual, &pos ) )
|
||||
{
|
||||
|
@ -874,7 +874,8 @@ void DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones()
|
|||
continue;
|
||||
|
||||
// Test for same net
|
||||
if( zoneRef->GetNetCode() == zoneToTest->GetNetCode() && zoneRef->GetNetCode() >= 0 )
|
||||
if( zoneRef->GetNetCode() == zoneToTest->GetNetCode()
|
||||
&& zoneRef->GetNetCode() >= 0 )
|
||||
continue;
|
||||
|
||||
// test for different priorities
|
||||
|
|
|
@ -995,7 +995,7 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
textpos.y = -textpos.y;
|
||||
|
||||
// approximate the size of the pad number text:
|
||||
double tsize = 1.5 * padsize.x / PrintableCharCount( padNumber );
|
||||
double tsize = 1.5 * padsize.x / std::max( PrintableCharCount( padNumber ), 1 );
|
||||
tsize = std::min( tsize, size );
|
||||
|
||||
// Use a smaller text size to handle interline, pen size...
|
||||
|
|
Loading…
Reference in New Issue