Bug 315548
| Summary: | [GStreamer][2.52.x] Unsafe buffer usage warnings with Clang 22 in FFTFrameGStreamer.cpp | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | Media | Assignee: | Adrian Perez <aperez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Other | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=309980 | ||
Adrian Perez
Building WebKitGTK 2.52.2 (or from the tip of the webkitglib/2.52 branch) with Clang 22.1.5 produces the following warnings:
/home/aperez/devel/WebKit-2.52/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:97:23: warning: direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking [-Wunsafe-buffer-usage-in-unique-ptr-array-access]
97 | imagData[i] = m_complexData[i].i;
| ^~~~~~~~~~~~~~~~
/home/aperez/devel/WebKit-2.52/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:98:23: warning: direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking [-Wunsafe-buffer-usage-in-unique-ptr-array-access]
98 | realData[i] = m_complexData[i].r;
| ^~~~~~~~~~~~~~~~
/home/aperez/devel/WebKit-2.52/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:108:9: warning: direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking [-Wunsafe-buffer-usage-in-unique-ptr-array-access]
108 | m_complexData[i].i = imagData[i];
| ^~~~~~~~~~~~~~~~
/home/aperez/devel/WebKit-2.52/Source/WebCore/platform/audio/gstreamer/FFTFrameGStreamer.cpp:109:9: warning: direct access using operator[] on std::unique_ptr<T[]> is unsafe due to lack of bounds checking [-Wunsafe-buffer-usage-in-unique-ptr-array-access]
109 | m_complexData[i].r = realData[i];
| ^~~~~~~~~~~~~~~~
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adrian Perez
This was already fixed in the “main” branch in revision 309309@main -- we can just backport the fix.
Adrian Perez
(In reply to Adrian Perez from comment #1)
> This was already fixed in the “main” branch in revision 309309@main -- we
> can just backport the fix.
Backport done in https://commits.webkit.org/305877.679@webkitglib/2.52
Radar WebKit Bug Importer
<rdar://problem/177926019>