Language: JavaScript
Label: vulnerable
CWE: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

Code:
EditorUi.prototype.isResampleImageSize=function(d,g){g=null!=g?g:this.resampleThreshold;return d>g};EditorUi.prototype.resizeImage=function(d,g,n,t,u,v,A){u=null!=u?u:this.maxImageSize;var H=Math.max(1,d.width),L=Math.max(1,d.height);if(t&&this.isResampleImageSize(null!=A?A:g.length,v))try{var F=Math.max(H/u,L/u);if(1<F){var S=Math.round(H/F),p=Math.round(L/F),q=document.createElement("canvas");q.width=S;q.height=p;q.getContext("2d").drawImage(d,0,0,S,p);var C=q.toDataURL();if(C.length<g.length){var J=