Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 19e127b1e23d0a25485d53ee9d17a4200f83ce8a
      
https://github.com/WebKit/WebKit/commit/19e127b1e23d0a25485d53ee9d17a4200f83ce8a
  Author: Adrian Perez de Castro <[email protected]>
  Date:   2025-02-11 (Tue, 11 Feb 2025)

  Changed paths:
    M Source/WebCore/platform/audio/DirectConvolver.cpp

  Log Message:
  -----------
  REGRESSION(288121@main): [WebAudio] DirectConvolver::process() tries to use 
use negative indexes on a std::span
https://bugs.webkit.org/show_bug.cgi?id=287431

Reviewed by Chris Dumez.

Before the conversion to std::span in 288121@main (970bbbc53b2d), the
calculation of the buffer indexes in the CONVOLVE_ONE_SAMPLE macro would
fit in the bounds of an "int" and the "float*" would be accessed with a
negative index. This was okay given that the base pointer intentionally
pointed to the middle of the buffer, and the macro would fetch values
from the first half of it.

With the switch to std::span, its array subindex operator would cause a
conversion of the calculated index to size_t, and trying to represent
the negative index as such results in the value wrapping around into
a huge (and invalid) index.

The simplest solution is to always calculate positive index values over
the whole buffer and use the std::span that refers to that, instead of
using the std::span that refers only to the second half of the buffer.

* Source/WebCore/platform/audio/DirectConvolver.cpp:
(WebCore::DirectConvolver::process):

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



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

Reply via email to