# PVRTTextureLoadFromPointer bug in 2.10

**URL:** <https://forums.imgtec.com/t/pvrttextureloadfrompointer-bug-in-2-10/1403>\
**Category:** PowerVR Insider\
**Created:** [May 2, 2012, 10:21pm UTC](https://forums.imgtec.com/t/pvrttextureloadfrompointer-bug-in-2-10/1403 "2012-05-02T22:21:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sniffy2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/sniffy2/32/146_2.png) [@sniffy2](https://forums.imgtec.com/u/sniffy2)\
**Post date:** [May 2, 2012, 10:21pm UTC](https://forums.imgtec.com/t/pvrttextureloadfrompointer-bug-in-2-10/1403/1 "2012-05-02T22:21:27Z")

</div>

There’s a bug in 2.10 PVRTTextureAPI.cpp PVRTTextureLoadFromPointer() fn in the iOS and Android SDK sample code. On Android, it fails to load ETC textures correctly.  
  
  
  
  
  
The problem is this line:  
  
  
  
  
  
#ifndef TARGET\_OS\_IPHONE //TODO  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if (eTextureFormat==GL\_ETC1\_RGB8\_OES)  
  
  
  
  
  
should be  
  
  
  
  
  
#ifndef TARGET\_OS\_IPHONE //TODO  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if (eTextureInternalFormat==GL\_ETC1\_RGB8\_OES)  
  
  
  
  
  
eTextureFormat is always 0 because PVRTGetOGLES2TextureFormat only sets eTextureInternalFormat, not eTextureFormat  
  
  
  
  
  
Posting here in case others run into same problem.

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [May 25, 2012, 7:43am UTC](https://forums.imgtec.com/t/pvrttextureloadfrompointer-bug-in-2-10/1403/2 "2012-05-25T07:43:50Z")

</div>

Hi Kris,  
  
Thanks for catching this - we don’t typically use ETC, so hadn’t noticed the problem. I’ve fixed this for our next release, in the meantime your fix is exactly the correct thing to do.  
  
Thanks,  
  
Tobias
