OpenPrinting / cups

OpenPrinting CUPS Sources
https://openprinting.github.io/cups
Apache License 2.0
958 stars 174 forks source link

Add additional parameter validation to _cupsRasterWritePixels #914

Closed yetamrra closed 3 months ago

yetamrra commented 3 months ago

If len is 0, the function does a lot of calculations that ultimately don't produce any output. This can be skipped with an early return.

If cupsBytesPerLine is 0, this triggers a divide by zero if the output isn't compressed. This is an error on the caller's part, but it's nicer to return an error than to crash.