Language: JavaScript
Label: safe
CWE: CWE-400 \u2014 Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.

Code:
f};EditorUi.prototype.resizeImage=function(d,f,g,m,q,y,F){q=null!=q?q:this.maxImageSize;var C=Math.max(1,d.width),H=Math.max(1,d.height);if(m&&this.isResampleImageSize(null!=F?F:f.length,y))try{var G=Math.max(C/q,H/q);if(1<G){var aa=Math.round(C/G),da=Math.round(H/G),ba=document.createElement("canvas");ba.width=aa;ba.height=da;ba.getContext("2d").drawImage(d,0,0,aa,da);var Y=ba.toDataURL();if(Y.length<f.length){var qa=document.createElement("canvas");qa.width=aa;qa.height=da;var O=qa.toDataURL();
Y!==O&&(f=Y,C=aa,H=da)}}}catch(X){}g(f,C,H)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,f,g){try{var m=new Image;m.onload=function(){m.width=0<m.width?m.width:120;m.height=0<m.height?m.height:120;f(m)};null!=g&&(m.onerror=g);m.src=d}catch(q){if(null!=g)g(q);else throw q;}};EditorUi.prototype.getDefaultSketchMode=function(){var d="ac.draw.io"==window.location.host?"1":"0";return"0"!=(null!=urlParams.rough?