From 86f7100de650155ef61c7903554ac4007769a2b5 Mon Sep 17 00:00:00 2001 From: goddardl Date: Thu, 15 May 2014 14:22:06 -0700 Subject: [PATCH 1/3] Initializing the m_mode member within the constructor. --- src/IECore/LensDistortOp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/IECore/LensDistortOp.cpp b/src/IECore/LensDistortOp.cpp index 3fb5cc851f..26a0883179 100644 --- a/src/IECore/LensDistortOp.cpp +++ b/src/IECore/LensDistortOp.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////// // -// Copyright (c) 2013, Image Engine Design Inc. All rights reserved. +// Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -55,7 +55,8 @@ LensDistortOp::LensDistortOp() : WarpOp( "Distorts an ImagePrimitive using a parametric lens model which is supplied as a .cob file. " "The resulting image will have the same display window as the original with a different data window." - ) + ), + m_mode( kUndistort ) { IntParameter::PresetsContainer modePresets; From 4a9210313038e337937444f7dc6e1cdabc92c406 Mon Sep 17 00:00:00 2001 From: goddardl Date: Thu, 15 May 2014 14:34:24 -0700 Subject: [PATCH 2/3] Fixed an uninitialized member in IECore::DeepPixel that could cause undefined behaviour when adding new samples. --- src/IECore/DeepPixel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/IECore/DeepPixel.cpp b/src/IECore/DeepPixel.cpp index 6bdfe17fa2..3375abef3b 100644 --- a/src/IECore/DeepPixel.cpp +++ b/src/IECore/DeepPixel.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////// // -// Copyright (c) 2011, Image Engine Design Inc. All rights reserved. +// Copyright (c) 2011-2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -41,7 +41,8 @@ using namespace IECore; DeepPixel::DeepPixel( const std::string channelNames, unsigned numSamples ) - : m_channels( channelNames.size() ) + : m_sorted( false ), + m_channels( channelNames.size() ) { m_depthIndices.reserve( numSamples ); m_samples.reserve( numSamples * ( 1 + channelNames.size() ) ); @@ -54,6 +55,7 @@ DeepPixel::DeepPixel( const std::string channelNames, unsigned numSamples ) } DeepPixel::DeepPixel( const std::vector &channelNames, unsigned numSamples ) + : m_sorted( false ) { m_depthIndices.reserve( numSamples ); m_samples.reserve( numSamples * ( 1 + channelNames.size() ) ); From ba11833ab890f52418eeb1cc3fd497b5e82148a3 Mon Sep 17 00:00:00 2001 From: goddardl Date: Thu, 15 May 2014 15:23:19 -0700 Subject: [PATCH 3/3] Fixed a bug in a sanity check in SHWDeepImageWriter. --- src/IECoreRI/SHWDeepImageWriter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/IECoreRI/SHWDeepImageWriter.cpp b/src/IECoreRI/SHWDeepImageWriter.cpp index 92d096d9fa..3021349f3b 100644 --- a/src/IECoreRI/SHWDeepImageWriter.cpp +++ b/src/IECoreRI/SHWDeepImageWriter.cpp @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////////////////////////// // -// Copyright (c) 2012, Image Engine Design Inc. All rights reserved. +// Copyright (c) 2012-2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are @@ -49,7 +49,7 @@ const DeepImageWriter::DeepImageWriterDescription SHWDeepIma SHWDeepImageWriter::SHWDeepImageWriter() : DeepImageWriter( "Writes 3delight SHW deep shadow file format." ), - m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ) + m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ), m_alphaOffset( 0 ) { std::vector channels( 1, "A" ); m_channelsParameter->setValue( new StringVectorData( channels ) ); @@ -60,7 +60,7 @@ SHWDeepImageWriter::SHWDeepImageWriter() SHWDeepImageWriter::SHWDeepImageWriter( const std::string &fileName ) : DeepImageWriter( "Writes 3delight SHW deep shadow file format." ), - m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ) + m_outputFile( 0 ), m_dtexCache( 0 ), m_dtexImage( 0 ), m_dtexPixel( 0 ), m_alphaOffset( 0 ) { m_fileNameParameter->setTypedValue( fileName ); @@ -164,7 +164,7 @@ void SHWDeepImageWriter::open() throw InvalidArgumentException( std::string( "Tile size must be equal to or less than resolution." ) ); } - if ( ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) || ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) ) + if ( ( ( tileSize.x & ( tileSize.x - 1 ) ) != 0 ) || ( ( tileSize.y & ( tileSize.y - 1 ) ) != 0 ) ) { throw InvalidArgumentException( std::string( "Tile width and height must be a power of two." ) ); }