The three.js project uses UPNG.js in its RGBMLoader for decoding PNGs in JavaScript. We have noticed that lgtm.com reports three alerts in context of UPNG.js:
It seems the i variable in this line is undefined and implicitly converted to number.
Would be great if these issue could be fixed in this repository and not in our local copy 👍 . The last two should be easy to fix, I'm unsure about the first one.
The
three.js
project usesUPNG.js
in itsRGBMLoader
for decoding PNGs in JavaScript. We have noticed that lgtm.com reports three alerts in context ofUPNG.js
:i
variable in this line isundefined
and implicitly converted to number.https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js#L90
foff
is not necessary since the variable is not used anymore in subsequent code.https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js#L205
di
is unused, since it's always overwritten. A variable declaration is sufficient.https://github.com/photopea/UPNG.js/blob/c976240e62b0497167f8aafabd7889625f8b2016/UPNG.js#L328
Would be great if these issue could be fixed in this repository and not in our local copy 👍 . The last two should be easy to fix, I'm unsure about the first one.