Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: media/test/pipeline_integration_fuzzertest.cc

Issue 1761603002: media: Handle "encrypted" event in pipeline_integration_fuzzertest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/test/pipeline_integration_fuzzertest.cc
diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc
index a00b3281a9b3fb935cb52dbebeb3c28c1a1c2e55..7b5a9a96694fc977d06b378cedc174bfce42d0f1 100644
--- a/media/test/pipeline_integration_fuzzertest.cc
+++ b/media/test/pipeline_integration_fuzzertest.cc
@@ -4,13 +4,26 @@
#include <stddef.h>
#include <stdint.h>
+#include <vector>
#include "base/at_exit.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "media/base/eme_constants.h"
#include "media/base/pipeline_status.h"
#include "media/test/pipeline_integration_test_base.h"
+namespace {
+
+void OnEncryptedMediaInitData(media::PipelineIntegrationTestBase* test,
+ media::EmeInitDataType /* type */,
+ const std::vector<uint8_t>& /* init_data */) {
+ test->FailTest(media::PIPELINE_ERROR_INITIALIZATION_FAILED);
+}
+
+} // namespace
+
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Media pipeline starts new threads, which needs AtExitManager.
@@ -21,6 +34,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
media::PipelineIntegrationTestBase test;
+ test.set_encrypted_media_init_data_cb(
+ base::Bind(&OnEncryptedMediaInitData, &test));
+
media::PipelineStatus pipeline_status =
test.Start(data, size, media::PipelineIntegrationTestBase::kClockless);
if (pipeline_status != media::PIPELINE_OK)
« no previous file with comments | « no previous file | media/test/pipeline_integration_test_base.h » ('j') | media/test/pipeline_integration_test_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698