Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a5528ec19a422e32f285548427385e098e7dbf39
      
https://github.com/WebKit/WebKit/commit/a5528ec19a422e32f285548427385e098e7dbf39
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp

  Log Message:
  -----------
  Fix size_t underflow in GridLayoutUtils::totalGuttersSize for empty grids
https://bugs.webkit.org/show_bug.cgi?id=319720
rdar://182554714

Reviewed by Sammy Gill.

totalGuttersSize() computed `tracksCount - 1` on a size_t guarded only
by ASSERT(tracksCount), so an empty grid (tracksCount == 0) underflows
to SIZE_MAX in release builds, producing a garbage gutters size instead
of zero. Guard the computation and return 0 directly when there are no
tracks. The ASSERT is kept so debug builds still flag callers that
reach this function with an empty grid unexpectedly.

* Source/WebCore/layout/formattingContexts/grid/GridLayoutUtils.cpp:
(WebCore::Layout::GridLayoutUtils::totalGuttersSize):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to