Message ID | 20190716060042.23035-1-laurent.pinchart@ideasonboard.com |
---|---|
State | Accepted |
Commit | a68cec65c196c24d122026bbc980028cc7d266cc |
Headers | show |
Series |
|
Related | show |
Hi Laurent, Thanks for your patch. On 2019-07-16 09:00:42 +0300, Laurent Pinchart wrote: > To avoid depending on unitialised values, set the pixelFormat field of > the StreamConfiguration class to 0 in the constructor. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> > --- > src/libcamera/stream.cpp | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp > index de505d12c07a..c28b4cd669b2 100644 > --- a/src/libcamera/stream.cpp > +++ b/src/libcamera/stream.cpp > @@ -289,7 +289,7 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const > * handlers provied StreamFormats. > */ > StreamConfiguration::StreamConfiguration() > - : memoryType(InternalMemory), stream_(nullptr) > + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr) > { > } > > @@ -297,7 +297,8 @@ StreamConfiguration::StreamConfiguration() > * \brief Construct a configuration with stream formats > */ > StreamConfiguration::StreamConfiguration(const StreamFormats &formats) > - : memoryType(InternalMemory), stream_(nullptr), formats_(formats) > + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr), > + formats_(formats) > { > } > > -- > Regards, > > Laurent Pinchart > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
Hi Laurent, Thanks for the patch. On Tue, Jul 16, 2019 at 09:00:42AM +0300, Laurent Pinchart wrote: > To avoid depending on unitialised values, set the pixelFormat field of > the StreamConfiguration class to 0 in the constructor. > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Looks good to me. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> > --- > src/libcamera/stream.cpp | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp > index de505d12c07a..c28b4cd669b2 100644 > --- a/src/libcamera/stream.cpp > +++ b/src/libcamera/stream.cpp > @@ -289,7 +289,7 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const > * handlers provied StreamFormats. > */ > StreamConfiguration::StreamConfiguration() > - : memoryType(InternalMemory), stream_(nullptr) > + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr) > { > } > > @@ -297,7 +297,8 @@ StreamConfiguration::StreamConfiguration() > * \brief Construct a configuration with stream formats > */ > StreamConfiguration::StreamConfiguration(const StreamFormats &formats) > - : memoryType(InternalMemory), stream_(nullptr), formats_(formats) > + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr), > + formats_(formats) > { > } > > -- > Regards, > > Laurent Pinchart > > _______________________________________________ > libcamera-devel mailing list > libcamera-devel@lists.libcamera.org > https://lists.libcamera.org/listinfo/libcamera-devel
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index de505d12c07a..c28b4cd669b2 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -289,7 +289,7 @@ SizeRange StreamFormats::range(unsigned int pixelformat) const * handlers provied StreamFormats. */ StreamConfiguration::StreamConfiguration() - : memoryType(InternalMemory), stream_(nullptr) + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr) { } @@ -297,7 +297,8 @@ StreamConfiguration::StreamConfiguration() * \brief Construct a configuration with stream formats */ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) - : memoryType(InternalMemory), stream_(nullptr), formats_(formats) + : pixelFormat(0), memoryType(InternalMemory), stream_(nullptr), + formats_(formats) { }
To avoid depending on unitialised values, set the pixelFormat field of the StreamConfiguration class to 0 in the constructor. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/libcamera/stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)