ApplyScissorViewport with disjoint scissor and scissorViewport causes crash in debug, undefined behaviour in release
- Dominant language
- C++
- Stars
- 20.5k
- Forks
- 2.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 90
Description
**Describe the bug**
When ApplyScissorViewport is called with disjoint rects, an assertion fails in debug builds and can cause underflow in release builds.
**To Reproduce**
In our project we encountered this using FilaGui and ImPlot, dragging the application from one display to another of a different resolution would crash reliably in debug builds due to the assertion.
**Expected behavior**
The issue is handled gracefully either through error propagation or ensuring the values are valid.
Contributor guide
Research direction
Start at the ApplyScissorViewport entry point and reproduce the issue with disjoint scissor and scissorViewport rectangles, including a display-resolution change like the reported FilaGui and ImPlot case. Done means debug builds no longer assert and release builds no longer encounter underflow or undefined behavior, with graceful handling as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100