# UpdateTextureRegions crashes on IOS

**URL:** <https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368>\
**Category:** Mobile\
**Tags:** unreal-engine, crash, bug-report, CPP, question\
**Created:** [August 7, 2014, 1:00pm UTC](https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368 "2014-08-07T13:00:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Peam](https://forums.unrealengine.com/u/Peam)\
**Post date:** [August 7, 2014, 1:00pm UTC](https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368/1 "2014-08-07T13:00:35Z")

</div>

I can’t get UpdateTextureRegions to work on my ipad air (IOS)

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

My application terminates right after it is called. However, it works fine for Win64 and Mac platform. The texture uploaded correctly.

Using BulkData.Lock works on IOS but it is too slow since I intend to update texture every frame with device’s camera image stream. Does anyone knows a more suitable method?

Here is a simplified function that crashes after a call on IOS (i made it into an exec function of a playercontroller):

```
   void ASimpleTest_PlayerController::UTT( )
    {
        static FUpdateTextureRegion2D Region = FUpdateTextureRegion2D(0, 0, 0, 0, 256, 256);
        static unsigned char array[256*256*4];
        for (int r = 0; r < 256;++r)
            for (int c = 0; c < 256;++c)
                for (int k = 0; k < 4;++k)
                {
                    array[r*256*4 + c*4 + k] = c+r;
                }
        
        CameraImageTexture = UTexture2D::CreateTransient(512, 512);
        CameraImageTexture->AddToRoot();
        // Allocate the texture HRI
        CameraImageTexture->UpdateResource();
        UpdateTextureRegions(CameraImageTexture, 0, 1, &Region, 256*4, 4, array, false);
    }

```

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a74133dd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a74133dd](https://forums.unrealengine.com/u/anonymous_user_a74133dd)\
**Post date:** [October 25, 2014, 3:18pm UTC](https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368/2 "2014-10-25T15:18:02Z")

</div>

HI Peam:  
Did u solve this problem now, I encountered same problem, currently I have to use BulkData.Lock, however iphone6 is powerful enough to make it real time.

---

<div class="post-metadata">

**Author:** ![RCaloca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RCaloca](https://forums.unrealengine.com/u/RCaloca)\
**Post date:** [October 28, 2014, 6:46pm UTC](https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368/3 "2014-10-28T18:46:57Z")

</div>

Hi Peam & , I added task UERNDR-8 to investigate/fix this; it’s crashing as it requires pixel buffer objects (not available on ES 2). A workaround is to call Lock/Unlock.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_45c2a24d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_45c2a24d](https://forums.unrealengine.com/u/anonymous_user_45c2a24d)\
**Post date:** [August 7, 2015, 5:07pm UTC](https://forums.unrealengine.com/t/updatetextureregions-crashes-on-ios/290368/4 "2015-08-07T17:07:48Z")

</div>

I used Lock and Unlock to go around this problem. It works but takes a little bit more time to lock.
