Skip to content

pwgtoraster: reject overflowing raster buffers - #210

Merged
tillkamppeter merged 2 commits into
OpenPrinting:masterfrom
carrerasdarren-cell:fix/pwgtoraster-row-overflow
Aug 21, 2026
Merged

pwgtoraster: reject overflowing raster buffers#210
tillkamppeter merged 2 commits into
OpenPrinting:masterfrom
carrerasdarren-cell:fix/pwgtoraster-row-overflow

Conversation

@carrerasdarren-cell

@carrerasdarren-cell carrerasdarren-cell commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • check horizontal row expansion before multiplying the input bytes-per-line
  • allocate vertical averaging and planar page buffers with checked factors
  • use size_t for averaging and planar row offsets, and handle all three allocation failures before raster decoding

Fixes #192.
Fixes #193.
Fixes #194.

Testing

Built the library with AddressSanitizer and UndefinedBehaviorSanitizer, then ran each issue's exact public Raster fixture through cfFilterPWGToRaster:

All three complete without sanitizer diagnostics. The normal sanitizer control set also passes 3/3 (testdither, testpdf1, and cupsfilters/testfilters.sh), and git diff --check passes.

@carrerasdarren-cell carrerasdarren-cell changed the title pwgtoraster: reject overflowing expanded rows pwgtoraster: reject overflowing raster buffers Aug 21, 2026
@tillkamppeter
tillkamppeter merged commit b95e5a4 into OpenPrinting:master Aug 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants