forked from WebKit/WebKit-http
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r205197 - Use of uninitialised memory in TransformationMatrx::b…
…lend4() https://bugs.webkit.org/show_bug.cgi?id=134621 <rdar://problem/27337539> Reviewed by Dean Jackson. Change is based on the Blink change (patch by <[email protected]>): <https://src.chromium.org/viewvc/blink?revision=177453&view=revision> Source/WebCore: TransformationMatrix::blend() was attempting to blend between non-invertable matricies. This resulted in garbage stack variables being used. This patch ensures that blend() will fall back to a 50% step interpolation when one of the sides are not invertable. Tested by new TransformationMatrix test in TestWebKitAPI. * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::blend2): Properly handle failure in the decompose method calls. (WebCore::TransformationMatrix::blend4): Ditto. Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp: Added. (TestWebKitAPI::TEST): git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.14@205591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
e5cf0b8
commit 788852e
Showing
6 changed files
with
106 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
2016-08-30 Brent Fulgham <[email protected]> | ||
|
||
Use of uninitialised memory in TransformationMatrx::blend4() | ||
https://bugs.webkit.org/show_bug.cgi?id=134621 | ||
<rdar://problem/27337539> | ||
|
||
Reviewed by Dean Jackson. | ||
|
||
Change is based on the Blink change (patch by <[email protected]>): | ||
<https://src.chromium.org/viewvc/blink?revision=177453&view=revision> | ||
|
||
TransformationMatrix::blend() was attempting to blend between non-invertable | ||
matricies. This resulted in garbage stack variables being used. | ||
This patch ensures that blend() will fall back to a 50% step interpolation | ||
when one of the sides are not invertable. | ||
|
||
Tested by new TransformationMatrix test in TestWebKitAPI. | ||
|
||
* platform/graphics/transforms/TransformationMatrix.cpp: | ||
(WebCore::TransformationMatrix::blend2): Properly handle failure in the | ||
decompose method calls. | ||
(WebCore::TransformationMatrix::blend4): Ditto. | ||
|
||
2016-08-30 Alex Christensen <[email protected]> | ||
|
||
URLParser should handle relative URLs that start with // | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
2016-08-30 Brent Fulgham <[email protected]> | ||
|
||
Use of uninitialised memory in TransformationMatrx::blend4() | ||
https://bugs.webkit.org/show_bug.cgi?id=134621 | ||
<rdar://problem/27337539> | ||
|
||
Reviewed by Dean Jackson. | ||
|
||
Change is based on the Blink change (patch by <[email protected]>): | ||
<https://src.chromium.org/viewvc/blink?revision=177453&view=revision> | ||
|
||
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: | ||
* TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp: Added. | ||
(TestWebKitAPI::TEST): | ||
|
||
2016-08-30 Alex Christensen <[email protected]> | ||
|
||
URLParser should handle relative URLs that start with // | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2013, Google Inc. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are | ||
* met: | ||
* | ||
* * Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* * Redistributions in binary form must reproduce the above | ||
* copyright notice, this list of conditions and the following disclaimer | ||
* in the documentation and/or other materials provided with the | ||
* distribution. | ||
* * Neither the name of Google Inc. nor the names of its | ||
* contributors may be used to endorse or promote products derived from | ||
* this software without specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include "config.h" | ||
#include <WebCore/TransformationMatrix.h> | ||
|
||
using namespace WebCore; | ||
|
||
namespace TestWebKitAPI { | ||
|
||
TEST(TransformationMatrix, NonInvertableBlend) | ||
{ | ||
TransformationMatrix from; | ||
TransformationMatrix to(2.7133590938, 0.0, 0.0, 0.0, 0.0, 2.4645137761, 0.0, 0.0, 0.0, 0.0, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05); | ||
TransformationMatrix result; | ||
|
||
result = to; | ||
result.blend(from, 0.25); | ||
EXPECT_TRUE(result == from); | ||
|
||
result = to; | ||
result.blend(from, 0.75); | ||
EXPECT_TRUE(result == to); | ||
} | ||
|
||
} |