Search Issue Tracker

Fixed in 2022.2.X

Fixed in 2021.3.X, 2022.1.X

Votes

1

Found in

2021.2

2021.2.18f1

2021.3

2022.1

2022.2

Issue ID

1417802

Regression

No

Unity crashes when compressing texture with non-power of 2 dimension size texture using Texture2D.Compress

Texture

-

How to reproduce:
1. Open the user's attached "compress_textures_test.zip" project
2. Open the Scene "SampleScene"
3. Enter the Play Mode
4. In the Game View press the "Create Texture 1000x1000" button (needs to be pressed either once or >=2 times in quick succession)

Expected results: No crash
Actual results: Crash

Reproducible with: 2021.2.19f1, 2021.3.1f1, 2022.1.0f1, 2022.2.0a10
Not reproducible with: 2019.4.38f1, 2020.3.33f1

Stacktrace:
0x00007ff7c0241c51 (Unity) tlsf_memalign
0x00007ff7be646e9d (Unity) DynamicHeapAllocator::Allocate
0x00007ff7be643734 (Unity) DualThreadAllocator<DynamicHeapAllocator>::Allocate
0x00007ff7be63d5b5 (Unity) MemoryManager::Allocate
0x00007ff7be6425dc (Unity) malloc_internal
0x00007ff7beaae174 (Unity) dynamic_array_detail::dynamic_array_data::resize_buffer
0x00007ff7bdb1ee48 (Unity) dynamic_array<signed char,0>::resize_buffer_nocheck
0x00007ff7be83309f (Unity) SharedTextureData::SharedTextureData
0x00007ff7be7f4d9f (Unity) Texture2D::InitTextureInternal
0x00007ff7be7f49c3 (Unity) Texture2D::InitTexture
0x00007ff7be7ecf05 (Unity) Texture2D::Compress
0x00007ff7bdc8e233 (Unity) Texture2D_CUSTOM_Compress

Notes:
- The issue is also reproducible on iOS and Android builds
- Code causing the crash:
Texture2D texture = new Texture2D(1000,1000);
texture.Compress(true);

  1. Resolution Note (fix version 2022.2):

    Fixed in Unity 2022.2.0a17

  2. Resolution Note (fix version 2021.3):

    Fixed in Unity 2021.3.5f1

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.