mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
549 stars 174 forks source link

Overflow checks in cmsCreateExtendedTransform #441

Closed gal1ium closed 5 months ago

gal1ium commented 6 months ago

Hi! We found a bug of missing a bound check in the API cmsCreateExtendedTransform at line https://github.com/mm2/Little-CMS/blob/lcms2.16/src/cmsxform.c#L1134 when nProfiles is 0, maybe similar to the situation at https://github.com/mm2/Little-CMS/issues/351 and https://github.com/mm2/Little-CMS/blob/lcms2.16/src/cmsxform.c#L1282

mm2 commented 6 months ago

Thanks. It make sense to add a check to behave like other transform generators. Should be fixed in 46355888b823b563db928faec59b0312a05e1143