Language: JavaScript
Label: safe
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,B){u=null!=u?u:this.maxImageSize;var H=Math.max(1,d.width),L=Math.max(1,d.height);if(t&&this.isResampleImageSize(null!=B?B:g.length,v))try{var G=Math.max(H/u,L/u);if(1<G){var T=Math.round(H/G),p=Math.round(L/G),q=document.createElement("canvas");q.width=T;q.height=p;q.getContext("2d").drawImage(d,0,0,T,p);var C=q.toDataURL();if(C.length<g.length){var J=