From 97b2bfdbe1b242b2d7cdd88ce3648388e8764e1c Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Wed, 24 Feb 2010 13:55:50 +1000 Subject: Fix off-by-one error in mipmap count when loading PVRTC files Task-number: QT-2988 Reviewed-by: Julian de Bhal --- src/opengl/qgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 22b0602..ca898c7 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -5451,7 +5451,7 @@ QSize QGLTexture::bindCompressedTexturePVR(const char *buf, int len) quint32 level = 0; quint32 width = pvrHeader->width; quint32 height = pvrHeader->height; - while (bufferSize > 0 && level < pvrHeader->mipMapCount) { + while (bufferSize > 0 && level <= pvrHeader->mipMapCount) { quint32 size = (qMax(width, minWidth) * qMax(height, minHeight) * pvrHeader->bitsPerPixel) / 8; -- cgit v0.12