Skip to content

Commit cdc0d50

Browse files
committed
Merge pull request #273 from goddardl/coverity
Minor fixes for issues highlighted by Coverity.
2 parents 86daba6 + ba11833 commit cdc0d50

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/IECore/DeepPixel.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2011, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -41,7 +41,8 @@
4141
using namespace IECore;
4242

4343
DeepPixel::DeepPixel( const std::string channelNames, unsigned numSamples )
44-
: m_channels( channelNames.size() )
44+
: m_sorted( false ),
45+
m_channels( channelNames.size() )
4546
{
4647
m_depthIndices.reserve( numSamples );
4748
m_samples.reserve( numSamples * ( 1 + channelNames.size() ) );
@@ -54,6 +55,7 @@ DeepPixel::DeepPixel( const std::string channelNames, unsigned numSamples )
5455
}
5556

5657
DeepPixel::DeepPixel( const std::vector<std::string> &channelNames, unsigned numSamples )
58+
: m_sorted( false )
5759
{
5860
m_depthIndices.reserve( numSamples );
5961
m_samples.reserve( numSamples * ( 1 + channelNames.size() ) );

src/IECore/LensDistortOp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -55,7 +55,8 @@ LensDistortOp::LensDistortOp()
5555
: WarpOp(
5656
"Distorts an ImagePrimitive using a parametric lens model which is supplied as a .cob file. "
5757
"The resulting image will have the same display window as the original with a different data window."
58-
)
58+
),
59+
m_mode( kUndistort )
5960
{
6061

6162
IntParameter::PresetsContainer modePresets;

src/IECoreRI/SHWDeepImageWriter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//////////////////////////////////////////////////////////////////////////
22
//
3-
// Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
3+
// Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved.
44
//
55
// Redistribution and use in source and binary forms, with or without
66
// modification, are permitted provided that the following conditions are
@@ -49,7 +49,7 @@ const DeepImageWriter::DeepImageWriterDescription<SHWDeepImageWriter> SHWDeepIma
4949

5050
SHWDeepImageWriter::SHWDeepImageWriter()
5151
: DeepImageWriter( "Writes 3delight SHW deep shadow file format." ),
52-
m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 )
52+
m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ), m_alphaOffset( 0 )
5353
{
5454
std::vector<std::string> channels( 1, "A" );
5555
m_channelsParameter->setValue( new StringVectorData( channels ) );
@@ -60,7 +60,7 @@ SHWDeepImageWriter::SHWDeepImageWriter()
6060

6161
SHWDeepImageWriter::SHWDeepImageWriter( const std::string &fileName )
6262
: DeepImageWriter( "Writes 3delight SHW deep shadow file format." ),
63-
m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 )
63+
m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ), m_alphaOffset( 0 )
6464
{
6565
m_fileNameParameter->setTypedValue( fileName );
6666

@@ -164,7 +164,7 @@ void SHWDeepImageWriter::open()
164164
throw InvalidArgumentException( std::string( "Tile size must be equal to or less than resolution." ) );
165165
}
166166

167-
if ( ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) || ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) )
167+
if ( ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) || ( ( tileSize.y & ( tileSize.y - 1 ) ) != 0 ) )
168168
{
169169
throw InvalidArgumentException( std::string( "Tile width and height must be a power of two." ) );
170170
}

0 commit comments

Comments
 (0)