Skip to content

Commit

Permalink
Fix numElements loop in RGBELoader (fixes #22388) (#22390)
Browse files Browse the repository at this point in the history
  • Loading branch information
OndrejSpanel authored Aug 21, 2021
1 parent 4b26288 commit 0aa81b5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/js/loaders/RGBELoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@
break;

case THREE.FloatType:
numElements = image_rgba_data.length / 4 * 3;
const floatArray = new Float32Array( numElements );
numElements = image_rgba_data.length / 4;
const floatArray = new Float32Array( numElements * 3 );

for ( let j = 0; j < numElements; j ++ ) {

Expand All @@ -395,8 +395,8 @@
break;

case THREE.HalfFloatType:
numElements = image_rgba_data.length / 4 * 3;
const halfArray = new Uint16Array( numElements );
numElements = image_rgba_data.length / 4;
const halfArray = new Uint16Array( numElements * 3 );

for ( let j = 0; j < numElements; j ++ ) {

Expand Down

0 comments on commit 0aa81b5

Please sign in to comment.