Title: [105457] trunk
Revision
105457
Author
[email protected]
Date
2012-01-19 15:47:33 -0800 (Thu, 19 Jan 2012)

Log Message

[Coverity] Fix uninitialized constructor defects in .../html
https://bugs.webkit.org/show_bug.cgi?id=74965

Patch by Greg Billock <[email protected]> on 2012-01-19
Reviewed by Simon Fraser.

Test: fast/canvas/script-tests/canvas-webkitLineDash.js

* html/HTMLFormCollection.cpp:
(WebCore::HTMLFormCollection::HTMLFormCollection):
* html/StepRange.cpp:
(WebCore::StepRange::StepRange):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State):
* html/canvas/CanvasStyle.h:
(WebCore::CanvasStyle::CMYKAValues::CMYKAValues):
* html/canvas/WebGLGetInfo.cpp:
(WebCore::WebGLGetInfo::WebGLGetInfo):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::CSSPreloadScanner):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::WebVTTParser):

Modified Paths

Diff

Modified: trunk/LayoutTests/fast/canvas/script-tests/canvas-webkitLineDash.js (105456 => 105457)


--- trunk/LayoutTests/fast/canvas/script-tests/canvas-webkitLineDash.js	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/LayoutTests/fast/canvas/script-tests/canvas-webkitLineDash.js	2012-01-19 23:47:33 UTC (rev 105457)
@@ -20,3 +20,9 @@
 shouldBe('lineDash[0]', '15');
 shouldBe('lineDash[1]', '10');
 shouldBe('ctx.webkitLineDashOffset', '5');
+
+// Verify that line dash offset persists after
+// clearRect (which causes a save/restore of the context
+// state to the stack).
+ctx.clearRect(0, 0, 700, 700);
+shouldBe('ctx.webkitLineDashOffset', '5');

Modified: trunk/Source/WebCore/ChangeLog (105456 => 105457)


--- trunk/Source/WebCore/ChangeLog	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/ChangeLog	2012-01-19 23:47:33 UTC (rev 105457)
@@ -1,3 +1,27 @@
+2012-01-19  Greg Billock  <[email protected]>
+
+        [Coverity] Fix uninitialized constructor defects in .../html
+        https://bugs.webkit.org/show_bug.cgi?id=74965
+
+        Reviewed by Simon Fraser.
+
+        Test: fast/canvas/script-tests/canvas-webkitLineDash.js
+
+        * html/HTMLFormCollection.cpp:
+        (WebCore::HTMLFormCollection::HTMLFormCollection):
+        * html/StepRange.cpp:
+        (WebCore::StepRange::StepRange):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::State::State):
+        * html/canvas/CanvasStyle.h:
+        (WebCore::CanvasStyle::CMYKAValues::CMYKAValues):
+        * html/canvas/WebGLGetInfo.cpp:
+        (WebCore::WebGLGetInfo::WebGLGetInfo):
+        * html/parser/CSSPreloadScanner.cpp:
+        (WebCore::CSSPreloadScanner::CSSPreloadScanner):
+        * html/track/WebVTTParser.cpp:
+        (WebCore::WebVTTParser::WebVTTParser):
+
 2012-01-19  Alexandru Chiculita  <[email protected]>
 
         CSS Shaders: Remove the setTimeout from the layout tests

Modified: trunk/Source/WebCore/html/HTMLFormCollection.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/HTMLFormCollection.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/HTMLFormCollection.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -37,6 +37,7 @@
 
 HTMLFormCollection::HTMLFormCollection(HTMLFormElement* form)
     : HTMLCollection(form, OtherCollection)
+    , currentPos(0)
 {
 }
 

Modified: trunk/Source/WebCore/html/StepRange.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/StepRange.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/StepRange.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -35,10 +35,10 @@
 
 StepRange::StepRange(const HTMLInputElement* element)
 {
-    if (element->hasAttribute(precisionAttr)) {
-        step = 1.0;
+    step = 1;
+    if (element->hasAttribute(precisionAttr))
         hasStep = !equalIgnoringCase(element->getAttribute(precisionAttr), "float");
-    } else
+    else
         hasStep = element->getAllowedValueStep(&step);
 
     maximum = element->maximum();

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -219,6 +219,7 @@
     , m_globalComposite(other.m_globalComposite)
     , m_transform(other.m_transform)
     , m_invertibleCTM(other.m_invertibleCTM)
+    , m_lineDashOffset(other.m_lineDashOffset)
     , m_textAlign(other.m_textAlign)
     , m_textBaseline(other.m_textBaseline)
     , m_unparsedFont(other.m_unparsedFont)

Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.h (105456 => 105457)


--- trunk/Source/WebCore/html/canvas/CanvasStyle.h	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.h	2012-01-19 23:47:33 UTC (rev 105457)
@@ -88,8 +88,8 @@
         RefPtr<CanvasPattern> m_pattern;
 
         struct CMYKAValues {
-            CMYKAValues() {}
-            CMYKAValues(float cyan, float magenta, float yellow, float black, float alpha) : c(cyan), m(magenta), y(yellow), k(black), a(alpha) {}
+            CMYKAValues() : c(0), m(0), y(0), k(0), a(0) { }
+            CMYKAValues(float cyan, float magenta, float yellow, float black, float alpha) : c(cyan), m(magenta), y(yellow), k(black), a(alpha) { }
             float c;
             float m;
             float y;

Modified: trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/canvas/WebGLGetInfo.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -45,11 +45,18 @@
 WebGLGetInfo::WebGLGetInfo(bool value)
     : m_type(kTypeBool)
     , m_bool(value)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(const bool* value, int size)
     : m_type(kTypeBoolArray)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
 {
     if (!value || size <=0)
         return;
@@ -60,83 +67,136 @@
 
 WebGLGetInfo::WebGLGetInfo(float value)
     : m_type(kTypeFloat)
+    , m_bool(false)
     , m_float(value)
+    , m_int(0)
+    , m_unsignedInt(0)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(int value)
     : m_type(kTypeInt)
+    , m_bool(false)
+    , m_float(0)
     , m_int(value)
+    , m_unsignedInt(0)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo()
     : m_type(kTypeNull)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(const String& value)
     : m_type(kTypeString)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
     , m_string(value)
+    , m_unsignedInt(0)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(unsigned int value)
     : m_type(kTypeUnsignedInt)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
     , m_unsignedInt(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLBuffer> value)
     : m_type(kTypeWebGLBuffer)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglBuffer(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Float32Array> value)
     : m_type(kTypeWebGLFloatArray)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglFloatArray(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLFramebuffer> value)
     : m_type(kTypeWebGLFramebuffer)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglFramebuffer(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Int32Array> value)
     : m_type(kTypeWebGLIntArray)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglIntArray(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLProgram> value)
     : m_type(kTypeWebGLProgram)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglProgram(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLRenderbuffer> value)
     : m_type(kTypeWebGLRenderbuffer)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglRenderbuffer(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLTexture> value)
     : m_type(kTypeWebGLTexture)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglTexture(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<Uint8Array> value)
     : m_type(kTypeWebGLUnsignedByteArray)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglUnsignedByteArray(value)
 {
 }
 
 WebGLGetInfo::WebGLGetInfo(PassRefPtr<WebGLVertexArrayObjectOES> value)
     : m_type(kTypeWebGLVertexArrayObjectOES)
+    , m_bool(false)
+    , m_float(0)
+    , m_int(0)
+    , m_unsignedInt(0)
     , m_webglVertexArrayObject(value)
 {
 }

Modified: trunk/Source/WebCore/html/parser/CSSPreloadScanner.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/parser/CSSPreloadScanner.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/parser/CSSPreloadScanner.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -38,6 +38,7 @@
 
 CSSPreloadScanner::CSSPreloadScanner(Document* document)
     : m_state(Initial)
+    , m_scanningBody(false)
     , m_document(document)
 {
 }

Modified: trunk/Source/WebCore/html/track/WebVTTParser.cpp (105456 => 105457)


--- trunk/Source/WebCore/html/track/WebVTTParser.cpp	2012-01-19 23:38:29 UTC (rev 105456)
+++ trunk/Source/WebCore/html/track/WebVTTParser.cpp	2012-01-19 23:47:33 UTC (rev 105457)
@@ -109,6 +109,8 @@
 WebVTTParser::WebVTTParser(WebVTTParserClient* client, ScriptExecutionContext* context)
     : m_scriptExecutionContext(context)
     , m_state(Initial)
+    , m_currentStartTime(0)
+    , m_currentEndTime(0)
     , m_tokenizer(WebVTTTokenizer::create())
     , m_client(client)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to