Diff
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-07-07 08:59:48 UTC (rev 186420)
@@ -1,3 +1,45 @@
+2015-06-19 Brent Fulgham <[email protected]>
+
+ Follow-up fix to r185766.
+ https://bugs.webkit.org/show_bug.cgi?id=22132
+
+ Reviewed by Zalan Bujtas.
+
+ Suggested by Darin Adler in the bug.
+
+ * platform/graphics/filters/FETile.cpp:
+ (WebCore::FETile::platformApplySoftware): Use WTF::move when passing
+ the new tileImageCopy RefPtr.
+
+2015-06-19 Brent Fulgham <[email protected]>
+
+ All calls of ImageBuffer::create should null check the return value
+ https://bugs.webkit.org/show_bug.cgi?id=22132
+
+ Reviewed by Zalan Bujtas.
+
+ ImageBuffer::create returns nullptr for a number of reasons, and should be
+ expected to do so. We missed this check in a few places, resulting in
+ crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
+ in normal use and should be checked.
+
+ * platform/graphics/BitmapImage.cpp:
+ (WebCore::BitmapImage::drawPattern): Add nullptr check for create and copyImage. Remove
+ extra call to 'setImageObserver'.
+ * platform/graphics/cairo/ImageBufferCairo.cpp:
+ (WebCore::ImageBuffer::drawPattern): Add nullptr check for copyImage.
+ * platform/graphics/cg/ImageBufferCG.cpp:
+ (WebCore::ImageBuffer::drawPattern): Add nullptr checks for copyImage.
+ * platform/graphics/filters/FETile.cpp:
+ (WebCore::FETile::platformApplySoftware): Add nullptr check for copyImage.
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::asImageBuffer): Add nullptr check for create.
+ (WebCore::FilterEffect::openCLImageToImageBuffer): Ditto.
+ * platform/graphics/texmap/BitmapTexture.cpp:
+ (WebCore::BitmapTexture::updateContents): Add nullptr checks for create and copyImage.
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::drawPatternForContainer): Add nullptr check for copyImage.
+
2015-06-18 Benjamin Poulain <[email protected]>
[CSS JIT][ARMv7] The pseudo element early exit trashes r6
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/BitmapImage.cpp (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/BitmapImage.cpp 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/BitmapImage.cpp 2015-07-07 08:59:48 UTC (rev 186420)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Samuel Weinig ([email protected])
- * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2008, 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -618,13 +618,14 @@
}
if (!m_cachedImage) {
std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(expandedIntSize(tileRect.size()));
- ASSERT(buffer.get());
+ if (!buffer)
+ return;
ImageObserver* observer = imageObserver();
ASSERT(observer);
// Temporarily reset image observer, we don't want to receive any changeInRect() calls due to this relayout.
- setImageObserver(0);
+ setImageObserver(nullptr);
draw(buffer->context(), tileRect, tileRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
@@ -632,9 +633,10 @@
buffer->convertToLuminanceMask();
m_cachedImage = buffer->copyImage(DontCopyBackingStore, Unscaled);
+ if (!m_cachedImage)
+ return;
+
m_cachedImage->setSpaceSize(spaceSize());
-
- setImageObserver(observer);
}
ctxt->setDrawLuminanceMask(false);
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2015-07-07 08:59:48 UTC (rev 186420)
@@ -161,8 +161,8 @@
void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform,
const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect, BlendMode)
{
- RefPtr<Image> image = copyImage(DontCopyBackingStore);
- image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
+ if (RefPtr<Image> image = copyImage(DontCopyBackingStore))
+ image->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
}
void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FETile.cpp (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FETile.cpp 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FETile.cpp 2015-07-07 08:59:48 UTC (rev 186420)
@@ -71,8 +71,12 @@
tileImageContext->translate(-inMaxEffectLocation.x(), -inMaxEffectLocation.y());
tileImageContext->drawImageBuffer(in->asImageBuffer(), ColorSpaceDeviceRGB, in->absolutePaintRect().location());
- auto pattern = Pattern::create(tileImage->copyImage(CopyBackingStore), true, true);
+ auto tileImageCopy = tileImage->copyImage(CopyBackingStore);
+ if (!tileImageCopy)
+ return;
+ auto pattern = Pattern::create(WTF::move(tileImageCopy), true, true);
+
AffineTransform patternTransform;
patternTransform.translate(inMaxEffectLocation.x() - maxEffectLocation.x(), inMaxEffectLocation.y() - maxEffectLocation.y());
pattern.get().setPatternSpaceTransform(patternTransform);
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FilterEffect.cpp (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/filters/FilterEffect.cpp 2015-07-07 08:59:48 UTC (rev 186420)
@@ -3,6 +3,7 @@
* Copyright (C) 2009 Dirk Schulze <[email protected]>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
* Copyright (C) 2012 University of Szeged
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -278,7 +279,7 @@
ImageBuffer* FilterEffect::asImageBuffer()
{
if (!hasResult())
- return 0;
+ return nullptr;
if (m_imageBufferResult)
return m_imageBufferResult.get();
#if ENABLE(OPENCL)
@@ -286,6 +287,9 @@
return openCLImageToImageBuffer();
#endif
m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size(), m_filter->filterScale(), m_resultColorSpace, m_filter->renderingMode());
+ if (!m_imageBufferResult)
+ return nullptr;
+
IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
if (m_premultipliedImageResult)
m_imageBufferResult->putByteArray(Premultiplied, m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
@@ -301,7 +305,7 @@
ASSERT(context);
if (context->inError())
- return 0;
+ return nullptr;
size_t origin[3] = { 0, 0, 0 };
size_t region[3] = { m_absolutePaintRect.width(), m_absolutePaintRect.height(), 1 };
@@ -309,12 +313,15 @@
RefPtr<Uint8ClampedArray> destinationPixelArray = Uint8ClampedArray::create(m_absolutePaintRect.width() * m_absolutePaintRect.height() * 4);
if (context->isFailed(clFinish(context->commandQueue())))
- return 0;
+ return nullptr;
if (context->isFailed(clEnqueueReadImage(context->commandQueue(), m_openCLImageResult, CL_TRUE, origin, region, 0, 0, destinationPixelArray->data(), 0, 0, 0)))
- return 0;
+ return nullptr;
m_imageBufferResult = ImageBuffer::create(m_absolutePaintRect.size());
+ if (!m_imageBufferResult)
+ return nullptr;
+
IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
m_imageBufferResult->putByteArray(Unmultiplied, destinationPixelArray.get(), destinationRect.size(), destinationRect, IntPoint());
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/graphics/SVGImage.cpp (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/graphics/SVGImage.cpp 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/graphics/SVGImage.cpp 2015-07-07 08:59:48 UTC (rev 186420)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Eric Seidel <[email protected]>
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2015 Apple Inc. All rights reserved.
* Copyright (C) Research In Motion Limited 2011. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -207,6 +207,8 @@
buffer->convertToLuminanceMask();
RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore, Unscaled);
+ if (!image)
+ return;
image->setSpaceSize(spaceSize());
// Adjust the source rect and transform due to the image buffer's scaling.
Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/ChangeLog (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/ChangeLog 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/ChangeLog 2015-07-07 08:59:48 UTC (rev 186420)
@@ -1,3 +1,19 @@
+2015-06-19 Brent Fulgham <[email protected]>
+
+ All calls of ImageBuffer::create should null check the return value
+ https://bugs.webkit.org/show_bug.cgi?id=22132
+
+ Reviewed by Zalan Bujtas.
+
+ ImageBuffer::create returns nullptr for a number of reasons, and should be
+ expected to do so. We missed this check in a few places, resulting in
+ crashes on some systems. Likewise, ImageBuffer::copyImage may return nullptr
+ in normal use and should be checked.
+
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::imageForCurrentSharingServicePickerItem): Add nullptr check
+ for copyImage.
+
2015-06-13 Chris Dumez <[email protected]>
[WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm (186419 => 186420)
--- releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm 2015-07-07 08:51:15 UTC (rev 186419)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm 2015-07-07 08:59:48 UTC (rev 186420)
@@ -471,6 +471,9 @@
frameView->setPaintBehavior(oldPaintBehavior);
RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore);
+ if (!image)
+ return nil;
+
return image->getNSImage();
}
#endif