69 lines
3.0 KiB
Diff
69 lines
3.0 KiB
Diff
Index: chromium-142.0.7444.3/media/base/media_switches.h
|
|
===================================================================
|
|
--- chromium-142.0.7444.3.orig/media/base/media_switches.h
|
|
+++ chromium-142.0.7444.3/media/base/media_switches.h
|
|
@@ -521,6 +521,8 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(
|
|
|
|
MEDIA_EXPORT BASE_DECLARE_FEATURE(kUseWindowBoundsForPip);
|
|
|
|
+MEDIA_EXPORT BASE_DECLARE_FEATURE(kFFmpegAllowLists);
|
|
+
|
|
MEDIA_EXPORT BASE_DECLARE_FEATURE(kMediaLogToConsole);
|
|
|
|
MEDIA_EXPORT BASE_DECLARE_FEATURE(kLibvpxUseChromeThreads);
|
|
Index: chromium-142.0.7444.3/media/base/media_switches.cc
|
|
===================================================================
|
|
--- chromium-142.0.7444.3.orig/media/base/media_switches.cc
|
|
+++ chromium-142.0.7444.3/media/base/media_switches.cc
|
|
@@ -1690,6 +1690,11 @@ bool IsRestrictOwnAudioSupported() {
|
|
#endif
|
|
}
|
|
|
|
+// Enables FFmpeg allow lists for supported codecs / containers.
|
|
+BASE_FEATURE(kFFmpegAllowLists,
|
|
+ "FFmpegAllowLists",
|
|
+ base::FEATURE_DISABLED_BY_DEFAULT);
|
|
+
|
|
#if BUILDFLAG(IS_WIN)
|
|
bool IsMediaFoundationD3D11VideoCaptureEnabled() {
|
|
return base::FeatureList::IsEnabled(kMediaFoundationD3D11VideoCapture);
|
|
Index: chromium-142.0.7444.3/media/ffmpeg/ffmpeg_common.cc
|
|
===================================================================
|
|
--- chromium-142.0.7444.3.orig/media/ffmpeg/ffmpeg_common.cc
|
|
+++ chromium-142.0.7444.3/media/ffmpeg/ffmpeg_common.cc
|
|
@@ -17,6 +17,7 @@
|
|
#include "media/base/audio_timestamp_helper.h"
|
|
#include "media/base/decoder_buffer.h"
|
|
#include "media/base/encryption_scheme.h"
|
|
+#include "media/base/media_switches.h"
|
|
#include "media/base/media_util.h"
|
|
#include "media/base/supported_types.h"
|
|
#include "media/base/video_aspect_ratio.h"
|
|
@@ -73,7 +74,8 @@ const char* GetAllowedVideoDecoders() {
|
|
void ApplyCodecContextSecuritySettings(AVCodecContext* codec_context) {
|
|
// Future versions of ffmpeg may copy the allow list from the format
|
|
// context.
|
|
- if (!codec_context->codec_whitelist) {
|
|
+ if (base::FeatureList::IsEnabled(kFFmpegAllowLists) &&
|
|
+ !codec_context->codec_whitelist) {
|
|
// Note: FFmpeg will try to free this string, so we must duplicate it.
|
|
codec_context->codec_whitelist =
|
|
av_strdup(codec_context->codec_type == AVMEDIA_TYPE_AUDIO
|
|
Index: chromium-142.0.7444.3/media/filters/ffmpeg_glue.cc
|
|
===================================================================
|
|
--- chromium-142.0.7444.3.orig/media/filters/ffmpeg_glue.cc
|
|
+++ chromium-142.0.7444.3/media/filters/ffmpeg_glue.cc
|
|
@@ -137,8 +137,10 @@ FFmpegGlue::FFmpegGlue(FFmpegURLProtocol
|
|
// memory usage.
|
|
//
|
|
// Note: FFmpeg will try to free these strings, so we must duplicate them.
|
|
- format_context_->codec_whitelist = av_strdup(GetAllowedAudioDecoders());
|
|
- format_context_->format_whitelist = av_strdup(GetAllowedDemuxers());
|
|
+ if (base::FeatureList::IsEnabled(kFFmpegAllowLists)) {
|
|
+ format_context_->codec_whitelist = av_strdup(GetAllowedAudioDecoders());
|
|
+ format_context_->format_whitelist = av_strdup(GetAllowedDemuxers());
|
|
+ }
|
|
}
|
|
|
|
bool FFmpegGlue::OpenContext(bool is_local_file) {
|