0

Enable -WUnsafe-buffer-usage in -media/gpu/v4l2/

Cq-Include-Trybots: luci.chromium.try:linux-asan-rel
Cq-Include-Trybots: luci.chromium.try:linux-cast-arm-rel
Cq-Include-Trybots: luci.chromium.try:linux-libfuzzer-asan-rel
Cq-Include-Trybots: luci.chromium.try:linux-v4l2-codec-rel
Bug: 40285824
Change-Id: I2f9f598931190afe504c610d61293bdc38d90e69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6171287
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407953}
This commit is contained in:
Arthur Sonzogni
2025-01-17 08:36:26 -08:00
committed by Chromium LUCI CQ
parent 6fec1bd5ee
commit 1a51b9dcb5
25 changed files with 121 additions and 5 deletions

@ -77,9 +77,6 @@
# as system headers when building with DEPOT_TOOLS_WIN_TOOLCHAIN=0 ?
-Program Files (x86)/Windows Kits/
# Please check 'linux-v4l2-codec-rel' bot before removing this opt-out.
-media/gpu/v4l2/
# //codelabs is a directory that contains examples for developers to modify as
# they learn about chromium development. This is indefinitely opt-out because
# it is not part of the main build, and we don't want developers to be blocked

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/chromeos/image_processor.h"
#include <sys/mman.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/chromeos/vulkan_overlay_adaptor.h"
#include <linux/videodev2.h>
@ -420,7 +425,6 @@ scoped_refptr<VideoFrame> ProcessFrameLibyuv(scoped_refptr<VideoFrame> in_frame,
break;
default:
NOTREACHED() << "Invalid overlay transform: " << transform;
return nullptr;
}
// Assemble a graph of the available LibYUV conversion functions.
@ -794,7 +798,7 @@ TEST_P(VulkanOverlayAdaptorTest, Correctness) {
VulkanOverlayAdaptor::Create(/*is_protected=*/false, GetParam().tiling);
bool performed_cleanup = false;
auto fence_helper =
auto* fence_helper =
vulkan_overlay_adaptor->GetVulkanDeviceQueue()->GetFenceHelper();
fence_helper->EnqueueCleanupTaskForSubmittedWork(base::BindOnce(
[](bool* cleanup_flag, gpu::VulkanDeviceQueue* device_queue,

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/legacy/v4l2_video_decode_accelerator.h"
#include <dlfcn.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/legacy/v4l2_video_decoder_backend_stateful.h"
#include <cstddef>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/test/h264_decoder.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/test/h265_decoder.h"
#include <linux/videodev2.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/test/v4l2_ioctl_shim.h"
#include <fcntl.h>

@ -5,6 +5,11 @@
#ifndef MEDIA_GPU_V4L2_TEST_V4L2_IOCTL_SHIM_H_
#define MEDIA_GPU_V4L2_TEST_V4L2_IOCTL_SHIM_H_
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include <linux/videodev2.h>
#include <string.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include <iostream>
#include <sstream>
#include <string>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/test/video_decoder.h"
#include <linux/videodev2.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/test/vp9_decoder.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_device.h"
#include <errno.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_image_processor_backend.h"
#include <errno.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_queue.h"
#include <errno.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_stateful_video_decoder.h"
#include <fcntl.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_utils.h"
#include <fcntl.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_utils.h"
#include <cstring>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_video_decoder_backend_stateless.h"
#include <fcntl.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_video_decoder_delegate_h264.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_video_decoder_delegate_h265.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "v4l2_video_decoder_delegate_vp8.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_video_decoder_delegate_vp9.h"
#include <linux/v4l2-controls.h>

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_vp9_helpers.h"
#include "base/containers/heap_array.h"

@ -2,6 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/v4l2/v4l2_vp9_helpers.h"
#include <vector>