Skip to content

fix(thumbnails): bound Qt Quick image requests before decoding media - #189

Merged
sanskarIN merged 4 commits into
mainfrom
fix/thumbnail-request-size-memory-cap-20261107
Nov 7, 2026
Merged

sanskarIN merged 4 commits into
mainfrom
fix/thumbnail-request-size-memory-cap-20261107

Conversation

@sanskarIN

Copy link
Copy Markdown
Owner

Finding

ThumbnailProvider::requestImageResponse() previously passed Qt Quick's requested thumbnail size directly to MLT/FFmpeg or still-image decoding, with no upper bound. A very large UI-provided size can drive disproportionate image/decoder allocations, even when the actual displayed thumbnail is small. The waveform provider already caps requests; the thumbnail provider did not.

This is independent memory-pressure hardening related to the editor crash investigations, not a demonstrated root cause of #175 or #185.

Changes

  • Introduce ThumbnailProvider::boundedRequestSize().
  • Preserve small, valid requests exactly (no unintended upscale).
  • Cap the largest requested image to 1920×1080 pixels, proportionally scaling down larger dimensions.
  • Invalid or zero dimensions fall back to 192×108.
  • Apply the same bound to ordinary cached thumbnails and source-excerpt frame requests before starting asynchronous decoder work.
  • Add a focused Qt test covering normal, invalid, 4K and extreme 100k-pixel requests.

Verification

  • Formatting / CMake test registration
  • Linux debug / static analysis and AddressSanitizer + UBSan
  • Windows MSYS2 tests and Windows packaged-binary verification
  • Review UI requests for unexpected aspect-ratio changes

No release or tag created; user-adjustable export FPS and project data remain unchanged.

@sanskarIN
sanskarIN marked this pull request as ready for review November 7, 2026 15:30
@sanskarIN
sanskarIN merged commit a31088b into main Nov 7, 2026
10 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

Development

Successfully merging this pull request may close these issues.

1 participant