Search Issue Tracker
Fixed in 2020.3.47f1, 2021.3.21f1
DownloadHandlerTexture crashes if it downloads invalid texture data
If a URL to non-texture data or malformed texture data is passed to DownloadHandlerTexture it will trigger a hard-crash in DownloadHandlerTexture::OnFinishReceiveData.
The cause appears to be that in DownloadHandlerTexture::OnFinishReceiveData CreateTextureFromBufferOnBackgroundThread can return null if the texture creation fails, one possible cause being a parsing error. The function then dereferences m_texture to call SetHideFlags.
The behaviour prior to the SetHideFlags call being added was that m_Texture would still end up null but this would ultimately result in a scripting exception. Since that was the case, it looks like a fix would be to simply wrap the SetHideFlags call in a null-check.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Applied velocity is inconsistent when using Rigidbody AddForce() with ForceMode.VelocityChange
- Crash on AudioUtil_CUSTOM_HasAudioCallback when exiting Play Mode while the Inspector is displaying a GameObject with an empty script attached
- Scroll offset is framerate-dependent when scrolling with velocity in the Device Simulator
- "Object.FindObjectsOfType<T>() is obsolete" warning is thrown when using "Transitions Plus" asset
- [Mono] Crash on SystemNative_ReadDirR() when building for IOS/Android on a macOS machine