summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* add a check for cmsFLAGS_COPY_ALPHAHEADmasterMarti Maria2023-05-161-0/+13
| | | | Thanks to ISOZAKI Nozomi to point out the issue.
* a preliminar implementation of OkLab color space as built-in profileMarti Maria2023-05-151-3/+114
| | | | | | Oklab is an alternative to CIE Lab. It works with the same logic, but claims to be more perceptually uniform than CIELab. Thanks to Lukas Sommer for the idea and Björn Ottosson for the documentation
* Simplify fixed-point to double conversion routinesNico Weber2023-05-041-19/+2
| | | | | | No behavior change. I checked that old and new code has the same results: https://godbolt.org/z/Eo3GT7rzP
* Merge branch 'master' of https://github.com/mm2/Little-CMSMarti Maria2023-04-262-6/+6
|\
| * add a way to get segments from tone curvesMarti Maria2023-04-232-6/+6
| | | | | | | | | | - Add a way to get segments from tone curves - Add a check for windows in meson file of fast-float plugin
* | fix black preservation on compound profile chainsMarti Maria2023-04-261-10/+23
|/ | | | K preservation now works with abstract profiles in the middle and and CMYK devicelinks at the end of the transform chain
* allow build of static libs on windows with MS Visual StudioMarti Maria2023-04-211-7/+10
| | | | Almost: meson uses always ".a" extension which is a pain. I can't solve that.
* make meson compile visual studio as wellMarti Maria2023-04-201-1/+1
| | | | MESON now compiles with VS2022, static lib and DLL
* Sanitize number of channels in profile elementsMarti Maria2023-04-181-2/+2
| | | | Prevent profiles claiming a wrong number of channels
* prevent to allocate a big chunk of memory on corrupted LUTMarti Maria2023-04-171-0/+3
| | | | Overflow here is harmless, but caller code may try to allocate a big chunk of memory, which will be immediatly freed because file size does not match.
* Add check for ill-formed CGATSMarti Maria2023-04-151-3/+8
| | | | Guard against redimensioning data in CGATS
* add bounds check when writing IT8 fileMarti Maria2023-03-261-23/+29
| | | | A minor check to get fuzzers happy. ICC parsing and processing is unaffected.
* Merge pull request #364 from amyspark/work/amyspark/roundtrip-headerMarti Maria2023-03-102-10/+25
|\ | | | | | | Roundtrip CMM, platform, and creator tags Checked to work on several computers. Thank you so much!
| * Roundtrip CMM, platform, and creator tagsL. E. Segovia2023-03-042-10/+25
| | | | | | | | | | This fixes generated MD5 checksums of existing profiles not matching between Windows and Unix-based systems.
* | Merge pull request #365 from amyspark/work/amyspark/add-msys2Marti Maria2023-03-061-1/+6
|\ \ | | | | | | | | | Fix MSYS2 compatibility Look great, thank you!
| * | Add missing private APIs for the pluginsL. E. Segovia2023-03-041-1/+6
| |/
* | Fix building on case sensitive mingw platformsKleis Auke Wolthuizen2023-03-031-1/+1
|/ | | | | | | | | | | Mingw headers are all lowercase, and can be used for cross compilation from case sensitive file systems. The official Windows SDK headers aren't self-consistent wrt upper/lower case, so those headers can't be used on case sensitive systems without a layer providing case insensitivity anyway. This matches other includes of windows.h throughout the codebase.
* refresh default build system from DebianMarti Maria2023-02-171-3/+3
| | | | Create a default configure in Debian
* version bumpMarti Maria2023-02-1626-26/+26
| | | | | In preparation to 2.15 release candidate Updated copyright year as well
* undo a change to recover an undocumented feature needed by colordMarti Maria2023-02-131-3/+3
| | | | ReadRawTag allows now to read portions of tag UNLESS the tag has been modified by cmsWriteTag
* save cgats to memory was wrong for one byteMarti Maria2023-01-101-3/+5
| | | | The ending zero was not properly counted. Fixed.
* Add check guards against NULL dereferencingMarti Maria2023-01-091-1/+7
| | | | Some additional checks that doesn't hurt.
* Empty statement in cmscam02.cSergey Bylokhov2023-01-041-1/+1
|
* Fixed a typoMarti Maria2023-01-031-1/+1
| | | | That break checks. I will investigate.
* Add more checking on multilocalized unicode tagsMarti Maria2023-01-032-2/+14
| | | | | Don't allow odd numbers as offsets on utf16 tables. Maybe some arcane profiles would use odd addresses and then define an utf16 table with a spare byte in the beginning, but I have checked my +10,000 ICC profiles zoo and none of the legal ones does that. It is likely someone is trying an exploit or a fuzzer is involved. Kill'em all
* Add range check for intents on cmsIsCLUTMarti Maria2023-01-031-0/+4
| | | | | | Add some bound-check for bad API usage Fixes #350 Thanks for reporting!
* sanitize cmsBuildTabulatedToneCurveFloat against bad API usageMarti Maria2023-01-032-1/+5
| | | | | sanitize cmsBuildTabulatedToneCurveFloat against bad API usage Fix for #351
* meson: Use the LCMS2 module export definitionL. E. Segovia2022-12-061-0/+1
|
* windows: Don't force a DLL output name, it will conflict with Meson library ↵L. E. Segovia2022-12-061-2/+0
| | | | naming convention
* meson: Automatically generate the DLL metadata for WindowsL. E. Segovia2022-12-062-0/+59
|
* meson: Refactor the Meson build filesL. E. Segovia2022-12-061-0/+48
|
* fix a typo in matrix checkMarti Maria2022-12-041-1/+1
| | | | Bad copy & paste habits
* Merge branch 'master' of https://github.com/mm2/Little-CMSMarti Maria2022-12-043-5/+12
|\
| * Enforce checks of matrices on absolute intentMarti Maria2022-12-012-5/+8
| | | | | | | | Non-happy path should be honored. Check for divide by zero as well.
| * Add a check for forged profiles with bad matricesMarti Maria2022-12-011-0/+4
| | | | | | | | Found by chrome fuzzer. Thanks!
* | Output on pre-multiplied alpha is now zero if alpha is zeroMarti Maria2022-12-041-4/+4
|/ | | | | Fixes #346 Output on pre-multiplied alpha is now zero if alpha is zero.
* fix a bug on BPC black point detection in case of matrix-shaper with ↵Marti Maria2022-11-271-3/+2
| | | | | | inverted curves. Thanks to Ralf Junker for finding the rare case.
* fix memory corruption when unregistering pluginsMarti Maria2022-11-121-7/+9
| | | | unregistering plugins twice may corrupt memory. This commit fixes that.
* sanitize cgats parserMarti Maria2022-09-071-28/+51
| | | | | | I don't know why people keeps fuzzing this code, but they do, and then they make a lot of noise. So let's make it less permissive and abort early when some wrong characters are found. I apologize if someone got hurt in the process. Otherwise this is harmless because is not used on ICC profile handling.
* Add more protection against attacksMarti Maria2022-09-012-1/+6
| | | | More code to filter bad API use
* Add checks for unsupported colorspaceMarti Maria2022-09-012-0/+9
| | | | Those profiles are just broken.
* Add a check for alpha 0 on premultiplied alphaMarti Maria2022-09-011-4/+10
| | | | Was missing in the generic cases
* Allow transform templates to be executed directly (it does nothing, though)Marti Maria2022-08-311-1/+33
| | | | You may create transforms with formatters 0, that means the format is to be specified latter on. So, you were not supposed to call this template with cmsDoTransform before setting the format, but fuzzer did. So I am putting code to prevent this... without including a condition that would ruin all cache and instruction branch guessing.
* An old function was returning a wrong valueMarti Maria2022-08-317-17/+29
| | | | | It makes no sense that cmsChannelsOf() returns 3 when colorspace is bugus. Added a new function that returns -1 instead. Will document that in 2.15. It is in the API now, but not in docs.
* Fix broken definitionMarti Maria2022-08-291-15/+15
| | | | | Moving a function definition to proper place (My C skills are decreasing every day)
* A better checker for ascii to int conversionMarti Maria2022-08-291-2/+9
| | | | People keeps trying to break tools helper code, so let's put guards.
* Fixed a memory leak in case of crafted profileMarti Maria2022-08-271-1/+4
| | | | Free resources accordly when detecting a wrong/crafted profile
* Fix a double free in case of errorMarti Maria2022-08-272-4/+4
| | | | | cmsReadTag already tracks its pointers so no need to free it Also fixed a cosmetic warning (no functionality changes)
* Add some validationsMarti Maria2022-08-262-7/+42
| | | | Makes no sense to accept profiles with absurd version numbers. That would keep fuzzers busy for a while.
* Add validation against broken profilesMarti Maria2022-08-221-9/+25
| | | | | | Crafted profiles with bogus data may be sometimes read but then not written. lcms is tolerant when reading, strict when writing. Fixed a situation that may end in memory corruption.