Clipboard: Windows text is bounded before it is converted, and each bitmap format has its own limit

The size of a CF_UNICODETEXT block is checked against the most UTF-8 it
could come to (3 bytes a code unit), so the converted text is never
larger than the limit. CF_DIBV5 and CF_DIB are each copied when they
fit the limit, so a large first format that doesn't decode still
leaves the second to paste.
This commit is contained in:
dotCooCoo
2026-11-15 12:06:56 -08:00
parent aadf451c71
commit f66aa65083
2 changed files with 40 additions and 42 deletions
+1 -1
View File
@@ -1982,7 +1982,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- Import and paste, 2026-10-13: a multi-artboard `.ai` with notes beside its artboards opens from its editing data, a page's art past its artboard no longer lying over the page before it (#1528); a `.ai` gradient whose stops are listed upwards keeps each midpoint on the stop that starts its part of the ramp (#1530); SVG text on a path follows basic shapes (circle, ellipse, rect, line, polyline, polygon) as their SVG 2 equivalent paths (#1531, fixes #1527); PDFs whose alpha soft masks are drawn as images import with the mask instead of empty art (#1551); EPS and PostScript type set in Type 42 (TrueType) fonts imports at its size instead of 1000 times too large (#1553); PDF and EPS import keep a clipping path whose bounding box covers the page but whose shape doesn't (#1544, fixes #1542). Opening or placing a file with an image too large to decode says so, and the Links panel shows it on the row (#1540, part of #1479). Paste takes a PDF or EPS another app copied as editable vector art: from the macOS pasteboard (with SVG), EPS on Windows beside PDF, and `.eps` files copied in a file manager, with the new command `clipboard.importEps` (#1538, fixes #1499).
- A `.ai` or `.ait` file copied in a file manager pastes as its art: one that holds a PDF pastes the objects of its editing data, and one saved as PostScript pastes as a copied `.eps` file does.
- Paste checks the size of a file copied in a file manager before reading it: a file of more than 64 MiB, VectorCraft's own limit, is skipped and the next copied file that is art pastes. A file that grows past the limit while it is read is skipped too, after at most one byte more than the limit is read.
- Paste checks the size of the data another app copied before copying it, and takes at most 64 MiB of a format, VectorCraft's own limit: on Windows each registered format, the two bitmap formats (CF_DIBV5 and CF_DIB, together), text (both its UTF-16 data and the UTF-8 text made from it) and the file list (CF_HDROP), and on macOS each pasteboard type. A larger format is skipped and the next one pastes. A list of more than 1,024 copied files pastes no file and no file in it is opened, as on the Linux clipboard; on Windows the names are counted before they are read (`clipboard::tests::clipboard_data_is_copied_only_when_its_size_fits`, `formats_copied_together_share_the_limit`, `a_copied_file_list_longer_than_the_limit_pastes_no_file`, `a_windows_file_list_is_counted_before_its_names_are_read`; not yet run on Windows or macOS).
- Paste checks the size of the data another app copied before copying it, and takes at most 64 MiB of a format, VectorCraft's own limit: on Windows each registered format, each of the two bitmap formats (CF_DIBV5 and CF_DIB), text (the most UTF-8 its UTF-16 data could come to, checked before it is converted) and the file list (CF_HDROP), and on macOS each pasteboard type. A larger format is skipped and the next one pastes. A list of more than 1,024 copied files pastes no file and no file in it is opened, as on the Linux clipboard; on Windows the names are counted before they are read (`clipboard::tests::clipboard_data_is_copied_only_when_its_size_fits`, `text_is_bounded_by_what_its_utf8_could_come_to`, `a_copied_file_list_longer_than_the_limit_pastes_no_file`, `a_windows_file_list_is_counted_before_its_names_are_read`; not yet run on Windows or macOS).
- A copied `.ai` or `.ait` file that holds a PDF pastes the objects of its editing data as File › Open reads them: every layer's objects go into the active layer in their stacking order, with their names, hidden objects and type objects, instead of the PDF page's art with its type as outlines. When the editing data can't be read, the file pastes its page as before (`clipboard.importPdf {editingData}`). The objects of a hidden layer come in hidden, from a pasted EPS too.
- Import and export, later 2026-10-13 merges: SVGs that move objects with a CSS transform (`translate(100px, 0)`, `rotate(45deg)`) or style type with the `font` shorthand import as drawn (#1565); SVG symbols whose shapes use percentage lengths import at the size and place they are drawn, the percentages being of the symbol's `viewBox` (#1596); Inkscape's flowed text (`flowRoot`) opens as area type in its rectangle, a paragraph per `flowPara`, instead of being dropped, and a region that can't be read is left out with a warning (#1569, fixes #1568); the warning for an unsupported SVG filter names the filter, its primitives and the object, and says the object is drawn without it (#1599, fixes #1598); the pages of an Inkscape multi-page SVG become artboards, named by their labels (#1603, fixes #1601); SVG export with CSS classes or style entities stays fast in documents with many distinct styles (#1567); PDF and `.ai` import: evenly letter-spaced or tightened type on a path keeps its length along the path instead of closing up to the font's advances (#1586), and type on a path whose stroke is written glyph by glyph comes in as one text object with its stroke, not one object per glyph (#1585); the ICC profiles embedded in JPEG, TIFF and PSD exports have every tag on a 4-byte boundary (ICC.1 §7.1.2), so strict readers accept them (#1589, fixes #1584); GIF, PNG-8 and other indexed exports find each pixel's palette colour through an index instead of a scan, with identical output (#1576); a zero-length subpath draws its round cap as a dot and its projecting cap as a square, so dots in imported `.ai` and SVG files show (#1619, fixes #1613).
- Files and untrusted input, 2026-10-14 merges: EPS import: a stitched shading keeps its hard colour changes (#1654, #1653). WMF/EMF import refuses an oversized embedded PNG or JPEG from its header, before any pixels are decoded (#1776). PDF open no longer takes exponential time on a crafted name tree with shared nodes when it looks for the editing data (#1781). The size limits on a native file's embedded data also apply to files read from memory, not only streamed ones (#1783). Saving over a private file on Unix no longer leaves a readable temporary copy beside it while the file is written (#1778). An Export for Screens suffix can no longer place files outside the export folder (#1777). Package refuses a folder where it would overwrite the open document or one of its linked files (#1786). ruzstd 0.9.1 fixes a decompression bomb (RUSTSEC-2026-0344) reachable from EPS/`.ai` and Affinity import (#1807). File Info dates are stamped only after a save succeeds, so a failed save no longer changes them (#1774). Linked files that change during a drag are updated after the drag instead of being missed (#1773).