Language: JavaScript
Label: vulnerable
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,l,q,y,F){q=null!=q?q:this.maxImageSize;var C=Math.max(1,d.width),H=Math.max(1,d.height);if(l&&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 l=new Image;l.onload=function(){l.width=0<l.width?l.width:120;l.height=0<l.height?l.height:120;f(l)};null!=g&&(l.onerror=g);l.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?