From 06735863719e08b44edebddcb97861f867bdc01d Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Tue, 2 Feb 2010 22:50:39 -0800 Subject: Fix ETC1 texture decoding. etc1_decode_image requires the stride argument to be in bytes, but the surface->stride field is in pixels. Convert by multiplying by pixel size. --- opengl/libagl/texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opengl') diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 73b1db4..a1a776f 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -1152,7 +1152,7 @@ void glCompressedTexImage2D( if (etc1_decode_image( (const etc1_byte*)data, (etc1_byte*)surface->data, - width, height, 3, surface->stride) != 0) { + width, height, 3, surface->stride*3) != 0) { ogles_error(c, GL_INVALID_OPERATION); } return; -- cgit v1.1