From d998cb0f769854973412032ae673eaadfb5b3a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 9 Aug 2016 11:07:44 +0200 Subject: [PATCH] Fix another pixel storage corner case. The test passes again. --- src/Magnum/PixelStorage.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Magnum/PixelStorage.h b/src/Magnum/PixelStorage.h index 8ccf35c0f..51b42da92 100644 --- a/src/Magnum/PixelStorage.h +++ b/src/Magnum/PixelStorage.h @@ -397,10 +397,21 @@ namespace Implementation { std::size_t dataOffset = 0; if(offset.z()) dataOffset += offset.z(); - else if(offset.y()) - dataOffset += offset.y(); - else if(offset.x()) - dataOffset += offset.x(); + else if(offset.y()) { + #ifndef MAGNUM_TARGET_GLES2 + if(!image.storage().imageHeight()) + #endif + { + dataOffset += offset.y(); + } + } else if(offset.x()) { + #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) + if(!image.storage().rowLength()) + #endif + { + dataOffset += offset.x(); + } + } return dataOffset + dataSize.product(); }