Fix possible infinite loop in dcraw

Use same type for variable comparison in loop condition. Fixes CodeQL
alert 96.
This commit is contained in:
Lawrence Lee 2024-03-02 20:55:07 -08:00
parent 65a14051fe
commit 6daf3f6a23
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F

View File

@ -345,7 +345,10 @@ int LibRaw::ljpeg_start(struct jhead *jh, int info_only)
if (jh->sraw)
{
FORC(4) jh->huff[2 + c] = jh->huff[1];
FORC(jh->sraw) jh->huff[1 + c] = jh->huff[0];
{
int c;
FORC(jh->sraw) jh->huff[1 + c] = jh->huff[0];
}
}
jh->row = (ushort *)calloc(jh->wide * jh->clrs, 16);
return zero_after_ff = 1;