diff options
Diffstat (limited to 'gfx/angle/src/image_util')
-rwxr-xr-x | gfx/angle/src/image_util/loadimage_etc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gfx/angle/src/image_util/loadimage_etc.cpp b/gfx/angle/src/image_util/loadimage_etc.cpp index b0881f728..39cdef20f 100755 --- a/gfx/angle/src/image_util/loadimage_etc.cpp +++ b/gfx/angle/src/image_util/loadimage_etc.cpp @@ -891,10 +891,10 @@ struct ETC2Block std::swap(dxEnd, dyEnd); } - for (size_t j = dyBegin; j < dyEnd; j++) + for (size_t j = dyBegin; j < dyEnd && (y + j) < h; j++) { int *row = &pixelIndices[j * 4]; - for (size_t i = dxBegin; i < dxEnd; i++) + for (size_t i = dxBegin; i < dxEnd && (x + i) < w; i++) { const size_t pixelIndex = subblockIdx * 4 + getIndex(i, j); row[i] = static_cast<int>(pixelIndex); |