scratchfoundation / scratch-vm

Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0
http://scratchfoundation.github.io/scratch-vm/
BSD 3-Clause "New" or "Revised" License
1.21k stars 1.51k forks source link

Need to safely handle case where bitmap fails to load #2220

Open benjiwheeler opened 5 years ago

benjiwheeler commented 5 years ago

If the bitmap loading in scratch-vm/src/import/load-costume.js's fetchBitmapCanvas_() function fails, we don't return any value from the promise.

This may be causing an error in loadBitmap_(), where we attempt to access the fetched.assetMatchesBase property without considering that fetched may never have received any value.

Example of a project that may be hitting this problem: https://scratch.mit.edu/projects/318191515/

apple502j commented 3 years ago

Bump, see also https://scratch.mit.edu/discuss/post/5207123 (reproable in Chromium-based browser, not in Firefox. Is this another strange bug?)