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
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);
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Standalone Player crashes with "TDerived GetOrLoad<TDerived>() where TDerived : T" when IL2CPP Code generation is set to "Faster (smaller) Builds"
- IndexOutOfRangeException and InvalidOperationException when logging XML string
- Script missing in "Assets/Settings/Mobile_Renderer/GlobalVolumeFeature" of "com.unity.template.urp-blank" template
- “Font Asset Creator - Error Code [Invalid_File_Structure]…“ error is logged when generating Font Assets from fonts with meta files from previous Editor versions
- Input.mousePosition returns (NaN, NaN, 0.00) when Scene view is opened
Resolution Note (fix version 2022.2):
Fixed in Unity 2022.2.0a17
Resolution Note (fix version 2021.3):
Fixed in Unity 2021.3.5f1