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

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

Issue 562543004: Check If ImageBuffer is allocated before proceeding. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | Source/platform/graphics/GraphicsContextTest.cpp » ('j') | 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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 { 124 {
125 IntRect paintRect = filter->sourceImageRect(); 125 IntRect paintRect = filter->sourceImageRect();
126 // Don't create empty ImageBuffers. 126 // Don't create empty ImageBuffers.
127 if (paintRect.isEmpty()) 127 if (paintRect.isEmpty())
128 return false; 128 return false;
129 129
130 OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSu rface(paintRect.size())); 130 OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSu rface(paintRect.size()));
131 if (!surface->isValid()) 131 if (!surface->isValid())
132 return false; 132 return false;
133 OwnPtr<ImageBuffer> image = ImageBuffer::create(surface.release()); 133 OwnPtr<ImageBuffer> image = ImageBuffer::create(surface.release());
134 if (!image)
Stephen White 2014/09/12 19:12:20 This change seems harmless, but note that this cod
sivag 2014/09/12 20:52:06 Thanks Stephen. Please let me know if some changes
135 return false;
134 136
135 GraphicsContext* imageContext = image->context(); 137 GraphicsContext* imageContext = image->context();
136 ASSERT(imageContext); 138 ASSERT(imageContext);
137 139
138 imageContext->translate(-paintRect.x(), -paintRect.y()); 140 imageContext->translate(-paintRect.x(), -paintRect.y());
139 imageContext->concatCTM(filter->absoluteTransform()); 141 imageContext->concatCTM(filter->absoluteTransform());
140 imageBuffer = image.release(); 142 imageBuffer = image.release();
141 return true; 143 return true;
142 } 144 }
143 145
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 markAllClientLayersForInvalidation(); 448 markAllClientLayersForInvalidation();
447 } 449 }
448 450
449 FloatRect RenderSVGResourceFilter::drawingRegion(RenderObject* object) const 451 FloatRect RenderSVGResourceFilter::drawingRegion(RenderObject* object) const
450 { 452 {
451 FilterData* filterData = m_filter.get(object); 453 FilterData* filterData = m_filter.get(object);
452 return filterData ? filterData->drawingRegion : FloatRect(); 454 return filterData ? filterData->drawingRegion : FloatRect();
453 } 455 }
454 456
455 } 457 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/GraphicsContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698