Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: da8462128955b0a095f803704003b777f12582da
      
https://github.com/WebKit/WebKit/commit/da8462128955b0a095f803704003b777f12582da
  Author: Geoffrey Garen <gga...@apple.com>
  Date:   2025-01-17 (Fri, 17 Jan 2025)

  Changed paths:
    M Source/WTF/wtf/IndexedRange.h
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
    M Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp
    M Source/WebCore/platform/graphics/cv/GraphicsContextGLCVCocoa.mm

  Log Message:
  -----------
  Eliminate unsafe buffer usage in GraphicsContextGLCVCocoa and 
GraphicsContextCG
https://bugs.webkit.org/show_bug.cgi?id=286100
rdar://143082904

Reviewed by Chris Dumez.

I pre-merged a little code from https://github.com/WebKit/WebKit/pull/39148 so
we don't end up conflicting.

* Source/WTF/wtf/IndexedRange.h:
(WTF::BoundsCheckedIterator::begin):
(WTF::BoundsCheckedIterator::end):
(WTF::BoundsCheckedIterator::BoundsCheckedIterator):
(WTF::boundsCheckedBegin):
(WTF::boundsCheckedEnd): use std::begin / std::end so we can do indexed and
zipped ranged for loops on C arrays.

* Source/WTF/wtf/TrailingArray.h: Paragraph separate first from last. (I came
here to try to add data(), but it's there already.)

* Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImageImpl): Updated for span.

* Source/WebCore/platform/graphics/GraphicsContextGLImageExtractor.h:
(WebCore::GraphicsContextGLImageExtractor::imagePixelData): Use span and
MallocSpan because UniqueArray doesn't know its length.

* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::setCGStyle): Use zippedRange instead of raw
indexing into a C array.

* Source/WebCore/platform/graphics/cg/GraphicsContextGLCG.cpp:
(WebCore::getSourceDataFormat): Use std::array and std::span.

(WebCore::GraphicsContextGLImageExtractor::extractImage):
* Source/WebCore/platform/graphics/cv/GraphicsContextGLCVCocoa.mm: Use 
std::array.

Canonical link: https://commits.webkit.org/289065@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to