Search Issue Tracker
Won't Fix
Votes
1
Found in
2017.1.1f1
Issue ID
971364
Regression
No
Unity crashes at GdipAlloc when saving bitmap to memory stream
How to reproduce:
1. Open given Unity project
2. Open scene "DoubleScene"
3. Enter play mode
Reproducible with: 5.6.4p3, 2017.1.2p3, 2017.2.0p3, 2017.3.0b10, 2018.1.0a5
Note: Script "PlayerRightEyeVideo.cs" crashes at line 38
Comments (1)
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
- Asset creation in the Project Browser is not always undone/inconsistent when the undo shortcut is pressed right after creating an asset
- JobTempAlloc memory leak warning is thrown when the Player is shut down
- Graphics State Collection warm-up does not work when using with Addressables Shaders
- "Baked Shadow Radius" field is visible but inactive when when the Shadow Type is set to "Hard Shadows" under the Light Component
- Crash on OnDemandScheduler::HandleImportWorkerLogs when performing various Unity operations
neosca
Jan 16, 2018 06:05
Same here, below is a sample function in which Unity is crashing when creating a new bitmap from memory stream.
public void tex(Texture2D t,string pictureName){
byte[] b = t.EncodeToPNG ();
var ms = new MemoryStream(b);
bb = new Bitmap (ms); //UNITY CRASHES ON THIS LINE
bb.Save(Application.persistentDataPath + "/" + pictureName + ".png" ,System.Drawing.Imaging.ImageFormat.Png);
}