Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: Source/core/rendering/svg/SVGInlineTextBox.cpp

Issue 196113002: Fix possible use of garbage value in acquirePaintingResource (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 354 }
355 355
356 bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, float scalingFactor, RenderObject* renderer, RenderStyle* style) 356 bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, float scalingFactor, RenderObject* renderer, RenderStyle* style)
357 { 357 {
358 // Callers must save the context state before calling when scalingFactor is not 1. 358 // Callers must save the context state before calling when scalingFactor is not 1.
359 ASSERT(scalingFactor); 359 ASSERT(scalingFactor);
360 ASSERT(renderer); 360 ASSERT(renderer);
361 ASSERT(style); 361 ASSERT(style);
362 ASSERT(m_paintingResourceMode != ApplyToDefaultMode); 362 ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
363 363
364 bool hasFallback; 364 bool hasFallback = false;
365 if (m_paintingResourceMode & ApplyToFillMode) 365 if (m_paintingResourceMode & ApplyToFillMode)
366 m_paintingResource = RenderSVGResource::fillPaintingResource(renderer, s tyle, hasFallback); 366 m_paintingResource = RenderSVGResource::fillPaintingResource(renderer, s tyle, hasFallback);
367 else if (m_paintingResourceMode & ApplyToStrokeMode) 367 else if (m_paintingResourceMode & ApplyToStrokeMode)
368 m_paintingResource = RenderSVGResource::strokePaintingResource(renderer, style, hasFallback); 368 m_paintingResource = RenderSVGResource::strokePaintingResource(renderer, style, hasFallback);
369 else { 369 else {
370 // We're either called for stroking or filling. 370 // We're either called for stroking or filling.
371 ASSERT_NOT_REACHED(); 371 ASSERT_NOT_REACHED();
372 } 372 }
373 373
374 if (!m_paintingResource) 374 if (!m_paintingResource)
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset)); 790 renderer().updateHitTestResult(result, locationInContainer.point () - toLayoutSize(accumulatedOffset));
791 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect)) 791 if (!result.addNodeToRectBasedTestResult(renderer().node(), requ est, locationInContainer, rect))
792 return true; 792 return true;
793 } 793 }
794 } 794 }
795 } 795 }
796 return false; 796 return false;
797 } 797 }
798 798
799 } // namespace WebCore 799 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698