Skip to content

filter: fix rastertoescpx and rastertopclx legacy paths#691

Open
kimaiden1984-boop wants to merge 1 commit into
OpenPrinting:masterfrom
kimaiden1984-boop:fix-cups-filters-escpx-pclx
Open

filter: fix rastertoescpx and rastertopclx legacy paths#691
kimaiden1984-boop wants to merge 1 commit into
OpenPrinting:masterfrom
kimaiden1984-boop:fix-cups-filters-escpx-pclx

Conversation

@kimaiden1984-boop

Copy link
Copy Markdown

Summary

This fixes two issues in the legacy cups-filters filter path:

  1. rastertoescpx no longer assumes ppd->sizes[1] exists when computing the printer top margin. It now uses the currently selected/default PageSize via ppdPageSize(ppd, NULL).
  2. rastertopclx no longer passes *cupsPCL EndJob directly to printf(). It now uses restricted page-count substitution so PPD data is not interpreted as an unrestricted format string.

Regression tests

Two regression tests are added and hooked into make check:

  • test-rastertoescpx-page-size
  • test-rastertopclx-format-string

Testing

make -C /data/pre-gsoc/cups-filters -j1 check TESTS='test-rastertopclx-format-string test-rastertoescpx-page-size'

Use the selected PPD page size instead of ppd->sizes[1] when computing rastertoescpx margins, and replace rastertopclx EndJob printf handling with a restricted page-count substitution helper.

Also add regression tests for both fixes and hook them into make check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant