Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f231156f34b99b4d1fae961ba492960414b04b4
      
https://github.com/WebKit/WebKit/commit/5f231156f34b99b4d1fae961ba492960414b04b4
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-08-26 (Wed, 26 Aug 2026)

  Changed paths:
    M Source/WebCore/html/CanvasNoiseInjection.cpp

  Log Message:
  -----------
  CanvasNoiseInjection lowerAndUpperBound mishandles neighbor ordering when 
component1 > component3
https://bugs.webkit.org/show_bug.cgi?id=318209
rdar://181010844

Reviewed by Kimmo Kinnunen.

In lowerAndUpperBound(component1, component2, component3) the second
branch (component1 > component3) had a duplicated condition. Line 223
used the "component2 above both neighbors" test
(component1 < component2 && component2 > component3) but returned the
middle-case interval { component3, component1 }, and a later branch
repeated that identical condition with the correct above-both return
value { component1, component2 }, leaving it permanently dead.

As a result, when component2 was above both neighbors it received the
middle-case bounds, and the genuine middle case
(component3 <= component2 <= component1) fell through every condition to
the degenerate { component2, component2 } default, collapsing the noise
interval to zero width for those pixels.

Give the first branch the middle-case condition
(component1 >= component2 && component2 >= component3) so all three
orderings mirror the component1 <= component3 branch:

    - middle      -> { component3, component1 }
    - below both  -> { component2, component3 }
    - above both  -> { component1, component2 }

* Source/WebCore/html/CanvasNoiseInjection.cpp:
(WebCore::lowerAndUpperBound):

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



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

Reply via email to