-
Notifications
You must be signed in to change notification settings - Fork 61
Reject VCL OBUs with mlayer_id/tlayer_id > max #5430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+78
−23
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| /* | ||
| * Copyright (c) 2026, Alliance for Open Media. All rights reserved | ||
| * | ||
| * This source code is subject to the terms of the BSD 3-Clause Clear License | ||
| * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear | ||
| * License was not distributed with this source code in the LICENSE file, you | ||
| * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the | ||
| * Alliance for Open Media Patent License 1.0 was not distributed with this | ||
| * source code in the PATENTS file, you can obtain it at | ||
| * aomedia.org/license/patent-license/. | ||
| */ | ||
|
|
||
| #include "third_party/googletest/src/googletest/include/gtest/gtest.h" | ||
|
|
||
| #include "config/avm_config.h" | ||
|
|
||
| #include "avm/avmdx.h" | ||
| #include "avm/avm_decoder.h" | ||
|
|
||
| namespace { | ||
|
|
||
| #if CONFIG_AV2_DECODER | ||
| // Regression test for bug found with libavif's avif_fuzztest_dec_experimental. | ||
| TEST(NoAssertionFailure, InvalidMlayerIdInNonKeyframeObu) { | ||
| // Bitstream containing: | ||
| // 1. OBU_SEQUENCE_HEADER (66 bytes) with max_mlayer_id = 0 | ||
| // 2. OBU_CLOSED_LOOP_KEY (57 bytes) with mlayer_id = 0 | ||
| // 3. OBU_SWITCH (8 bytes) with mlayer_id = 5 (> max_mlayer_id) | ||
| static const uint8_t kBitstream[] = { | ||
| 0x41, 0x04, 0x85, 0xf6, 0x1c, 0x1c, 0x94, 0x98, 0x93, 0x08, 0xa8, 0xb1, | ||
| 0xc0, 0xb5, 0x7e, 0x01, 0xec, 0xa1, 0x40, 0x77, 0x28, 0x55, 0x37, 0x45, | ||
| 0x00, 0x03, 0xec, 0x1a, 0xeb, 0x2d, 0x2c, 0x5f, 0xcd, 0x00, 0x1f, 0x3a, | ||
| 0xd0, 0x3f, 0xe8, 0xf6, 0x7d, 0x2a, 0x0d, 0xd1, 0x51, 0x40, 0x12, 0x00, | ||
| 0x32, 0x23, 0xc5, 0x28, 0x04, 0xe0, 0x40, 0x00, 0x00, 0x23, 0x43, 0x30, | ||
| 0x00, 0x42, 0xc1, 0x77, 0x00, 0x80, 0x38, 0x10, 0xf5, 0x91, 0xe5, 0x20, | ||
| 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x9d, 0x5c, 0x09, 0x01, | ||
| 0x8c, 0x1a, 0x4b, 0x50, 0x44, 0x00, 0x37, 0x0c, 0x8d, 0xd6, 0x84, 0x05, | ||
| 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x04, 0x04, | ||
| 0x71, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, | ||
| 0x04, 0x05, 0x04, 0x07, 0xa8, 0xa0, 0xfc, 0x4e, 0x08, 0x04, 0x04, | ||
| }; | ||
|
|
||
| avm_codec_ctx_t dec; | ||
| ASSERT_EQ(AVM_CODEC_OK, | ||
| avm_codec_dec_init(&dec, avm_codec_av2_dx(), NULL, 0)); | ||
| EXPECT_EQ(AVM_CODEC_UNSUP_BITSTREAM, | ||
| avm_codec_decode(&dec, kBitstream, sizeof(kBitstream), NULL)); | ||
| EXPECT_EQ(AVM_CODEC_OK, avm_codec_destroy(&dec)); | ||
| } | ||
| #endif // CONFIG_AV2_DECODER | ||
|
|
||
| } // namespace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.