Here maxH and maxV are initialized to zero, but since there are no components, the values are never modified, leading to a divide by zero error in the last two line (which set mcusPerLine and mcusPerColumn to Infinity).
These values are later used inside the decodeAsScan() function, where the following loop condition never evaluates to false since mcuExpected is set to frame.mcusPerLine * frame.mcusPerColumn (i.e. Infinity * Infinity) at line 292 in /lib/decoder.js.
The following input can create a infinite loop inside jpeg-js causing it to never return:
Based on some preliminary debugging it appears to be related to the following code:
jpeg-js/lib/decoder.js
Lines 579 to 589 in b58cc11
Here
maxHandmaxVare initialized to zero, but since there are no components, the values are never modified, leading to a divide by zero error in the last two line (which setmcusPerLineandmcusPerColumntoInfinity).These values are later used inside the
decodeAsScan()function, where the following loop condition never evaluates to false sincemcuExpectedis set toframe.mcusPerLine * frame.mcusPerColumn(i.e.Infinity * Infinity) at line 292 in/lib/decoder.js.jpeg-js/lib/decoder.js
Line 297 in b58cc11
found using jsfuzz
The text was updated successfully, but these errors were encountered: