You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
As with the image above, it seems to be possible to create a crafted JPEG file which will prompt lepton to produce a LEP file which, when converted back to JPEG to verify that the compression was lossless, will throw lepton into an infinite loop, hanging the process until it's killed. The sensitive section of code seems to be the following bit in jpgcoder.cc:
/* ----------------------------------------------- run of EOB encoding routine ----------------------------------------------- */intencode_eobrun( abitwriter*huffw, huffCodes*actbl, unsigned int*eobrun )
{{{}}
unsigned shortn;
unsigned ints;
inthc;
if ( (*eobrun) >0 ) {
while ( (*eobrun) >actbl->max_eobrun ) {
huffw->write( actbl->cval[ 0xE0 ], actbl->clen[ 0xE0 ] );
huffw->write( E_ENVLI( 14, 32767 ), 14 );
(*eobrun) -=actbl->max_eobrun;
{{ }}}
s=uint16bit_length((*eobrun));
dev_assert(s&&"actbl->max_eobrun needs to be > 0");
if (s) s--;
n=E_ENVLI( s, (*eobrun) );
hc= ( s << 4 );
huffw->write( actbl->cval[ hc ], actbl->clen[ hc ] );
huffw->write( n, s );
(*eobrun) =0;
}
return0;
}
The text was updated successfully, but these errors were encountered:
This issue was originally reported by Tenable.
As with the image above, it seems to be possible to create a crafted JPEG file which will prompt lepton to produce a LEP file which, when converted back to JPEG to verify that the compression was lossless, will throw lepton into an infinite loop, hanging the process until it's killed. The sensitive section of code seems to be the following bit in jpgcoder.cc:
The text was updated successfully, but these errors were encountered: