summaryrefslogtreecommitdiffstats
path: root/opengl/shared/OpenglCodecCommon/GLClientState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'opengl/shared/OpenglCodecCommon/GLClientState.cpp')
-rw-r--r--opengl/shared/OpenglCodecCommon/GLClientState.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/opengl/shared/OpenglCodecCommon/GLClientState.cpp b/opengl/shared/OpenglCodecCommon/GLClientState.cpp
index 9795490..a84e856 100644
--- a/opengl/shared/OpenglCodecCommon/GLClientState.cpp
+++ b/opengl/shared/OpenglCodecCommon/GLClientState.cpp
@@ -224,6 +224,8 @@ int GLClientState::setPixelStore(GLenum param, GLint value)
size_t GLClientState::pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const
{
+ if (width <= 0 || height <= 0) return 0;
+
int pixelsize = glUtilsPixelBitSize(format, type) >> 3;
int alignment = pack ? m_pixelStore.pack_alignment : m_pixelStore.unpack_alignment;