Commit b33e2313 authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

minor

parent d168c2b9
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
#include <GL/gl.h> #include <GL/gl.h>
#include <Gl/glu.h> #include <GL/glu.h>
#ifdef HAVE_CUDA #ifdef HAVE_CUDA
#include <cuda_gl_interop.h> #include <cuda_gl_interop.h>
...@@ -1191,6 +1191,7 @@ cv::gpu::GlBuffer::Impl::Impl(int rows, int cols, int type, unsigned int target) ...@@ -1191,6 +1191,7 @@ cv::gpu::GlBuffer::Impl::Impl(int rows, int cols, int type, unsigned int target)
glFuncTab()->genBuffers(1, &buffer_); glFuncTab()->genBuffers(1, &buffer_);
CV_CheckGlError(); CV_CheckGlError();
CV_Assert(buffer_ != 0);
size_t size = rows * cols * CV_ELEM_SIZE(type); size_t size = rows * cols * CV_ELEM_SIZE(type);
...@@ -1219,6 +1220,7 @@ cv::gpu::GlBuffer::Impl::Impl(const Mat& m, unsigned int target) : buffer_(0) ...@@ -1219,6 +1220,7 @@ cv::gpu::GlBuffer::Impl::Impl(const Mat& m, unsigned int target) : buffer_(0)
glFuncTab()->genBuffers(1, &buffer_); glFuncTab()->genBuffers(1, &buffer_);
CV_CheckGlError(); CV_CheckGlError();
CV_Assert(buffer_ != 0);
size_t size = m.rows * m.cols * m.elemSize(); size_t size = m.rows * m.cols * m.elemSize();
...@@ -1582,6 +1584,7 @@ cv::gpu::GlTexture::Impl::Impl(int rows, int cols, int type) : tex_(0) ...@@ -1582,6 +1584,7 @@ cv::gpu::GlTexture::Impl::Impl(int rows, int cols, int type) : tex_(0)
glGenTextures(1, &tex_); glGenTextures(1, &tex_);
CV_CheckGlError(); CV_CheckGlError();
CV_Assert(tex_ != 0);
glBindTexture(GL_TEXTURE_2D, tex_); glBindTexture(GL_TEXTURE_2D, tex_);
CV_CheckGlError(); CV_CheckGlError();
...@@ -1616,6 +1619,7 @@ cv::gpu::GlTexture::Impl::Impl(const Mat& mat, bool bgra) : tex_(0) ...@@ -1616,6 +1619,7 @@ cv::gpu::GlTexture::Impl::Impl(const Mat& mat, bool bgra) : tex_(0)
glGenTextures(1, &tex_); glGenTextures(1, &tex_);
CV_CheckGlError(); CV_CheckGlError();
CV_Assert(tex_ != 0);
glBindTexture(GL_TEXTURE_2D, tex_); glBindTexture(GL_TEXTURE_2D, tex_);
CV_CheckGlError(); CV_CheckGlError();
...@@ -1643,13 +1647,14 @@ cv::gpu::GlTexture::Impl::Impl(const GlBuffer& buf, bool bgra) : tex_(0) ...@@ -1643,13 +1647,14 @@ cv::gpu::GlTexture::Impl::Impl(const GlBuffer& buf, bool bgra) : tex_(0)
int depth = buf.depth(); int depth = buf.depth();
int cn = buf.channels(); int cn = buf.channels();
CV_DbgAssert(buf.rows() > 0 && buf.cols() > 0); CV_DbgAssert(buf.rows > 0 && buf.cols > 0);
CV_Assert(cn == 1 || cn == 3 || cn == 4); CV_Assert(cn == 1 || cn == 3 || cn == 4);
CV_Assert(depth >= 0 && depth <= CV_32F); CV_Assert(depth >= 0 && depth <= CV_32F);
CV_Assert(buf.usage() == GlBuffer::TEXTURE_BUFFER); CV_Assert(buf.usage() == GlBuffer::TEXTURE_BUFFER);
glGenTextures(1, &tex_); glGenTextures(1, &tex_);
CV_CheckGlError(); CV_CheckGlError();
CV_Assert(tex_ != 0);
glBindTexture(GL_TEXTURE_2D, tex_); glBindTexture(GL_TEXTURE_2D, tex_);
CV_CheckGlError(); CV_CheckGlError();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment