Closed
Bug 1238777
Opened 10 years ago
Closed 10 years ago
Make ComputeSnappedImageDrawingParameters more robust against 0-sized source image regions
Categories
(Core :: Layout: Images, Video, and HTML Frames, defect)
Core
Layout: Images, Video, and HTML Frames
Tracking
()
RESOLVED
FIXED
mozilla46
| Tracking | Status | |
|---|---|---|
| firefox46 | --- | fixed |
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(1 file)
|
1.32 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
(This is a followup to bug 1224736)
As discussed in bug 1224736 comment 35, if we can get ourselves to attempt to draw a 0-sized RasterImage into a nonzero-sized destination area, then ComputeSnappedImageDrawingParameters produces a bogus transform (with NaN scale factors) and we end up busting our internal graphics state, and breaking subsequent perfectly-good drawing commands with errors like:
[GFX2-]: DrawTargetCairo context in error state: invalid matrix (not invertible)(5)
[GFX2-]: ASurface Init failed with Cairo status 1 on 0x0x7ff5dd6e95b8
We should make ComputeSnappedImageDrawingParameters handle this sort of breakage more graceful (refusing to perform the original busted draw operation in question).
| Assignee | ||
Comment 1•10 years ago
|
||
Here's the fix. This patch makes us bail if |subimage| is zero-sized. (A little further down, we divide by subimage's width & height -- via a call to TransformBetweenRects -- which means we divide by 0. So, good to bail before that happens.)
I've verified locally that this patch is sufficient to fix bug 1224736 (even in the absence of bug 1224736's own patch).
Attachment #8706661 -
Flags: review?(tnikkel)
Updated•10 years ago
|
Attachment #8706661 -
Flags: review?(tnikkel) → review+
Comment 3•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Updated•8 years ago
|
Product: Core → Core Graveyard
Updated•8 years ago
|
Product: Core Graveyard → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•