Commit 8be279a285 for aom

commit 8be279a285594025fc1f94216232f24fb649f0af
Author: Wan-Teh Chang <wtc@google.com>
Date:   Fri Mar 27 09:47:27 2026 -0700

    Revert "av1/decoder/obu.c: don't fail on undefined levels"

    This reverts commit 1f9bfc65de63a01bd8c256eeb22f121915ea135f.

    Reason for revert: The SVT-AV1 bug was fixed in SVT-AV1 v4.0.0

    Bug: 471949427
    Change-Id: Ida561c3083324e915a0d26fc62009b4f406ac13c

diff --git a/av1/decoder/obu.c b/av1/decoder/obu.c
index 1075885ca0..9df0e88255 100644
--- a/av1/decoder/obu.c
+++ b/av1/decoder/obu.c
@@ -78,6 +78,14 @@ static void byte_alignment(struct aom_internal_error_info *error_info,

 static uint32_t read_temporal_delimiter_obu(void) { return 0; }

+// Returns a boolean that indicates success.
+static int read_bitstream_level(AV1_LEVEL *seq_level_idx,
+                                struct aom_read_bit_buffer *rb) {
+  *seq_level_idx = aom_rb_read_literal(rb, LEVEL_BITS);
+  if (!is_valid_seq_level_idx(*seq_level_idx)) return 0;
+  return 1;
+}
+
 // Returns whether two sequence headers are consistent with each other.
 // Note that the 'op_params' field is not compared per Section 7.5 in the spec:
 //   Within a particular coded video sequence, the contents of
@@ -128,7 +136,11 @@ static uint32_t read_sequence_header_obu(AV1Decoder *pbi,
     seq_params->operating_points_cnt_minus_1 = 0;
     seq_params->operating_point_idc[0] = 0;
     seq_params->has_nonzero_operating_point_idc = false;
-    seq_params->seq_level_idx[0] = aom_rb_read_literal(rb, LEVEL_BITS);
+    if (!read_bitstream_level(&seq_params->seq_level_idx[0], rb)) {
+      aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
+                         "Value %d of seq_level_idx[%d] is not yet defined",
+                         seq_params->seq_level_idx[0], 0);
+    }
     seq_params->tier[0] = 0;
     seq_params->op_params[0].decoder_model_param_present_flag = 0;
     seq_params->op_params[0].display_model_param_present_flag = 0;
@@ -152,7 +164,11 @@ static uint32_t read_sequence_header_obu(AV1Decoder *pbi,
           aom_rb_read_literal(rb, OP_POINTS_IDC_BITS);
       if (seq_params->operating_point_idc[i] != 0)
         seq_params->has_nonzero_operating_point_idc = true;
-      seq_params->seq_level_idx[i] = aom_rb_read_literal(rb, LEVEL_BITS);
+      if (!read_bitstream_level(&seq_params->seq_level_idx[i], rb)) {
+        aom_internal_error(&pbi->error, AOM_CODEC_UNSUP_BITSTREAM,
+                           "Value %d of seq_level_idx[%d] is not yet defined",
+                           seq_params->seq_level_idx[i], i);
+      }
       // This is the seq_level_idx[i] > 7 check in the spec. seq_level_idx 7
       // is equivalent to level 3.3.
       if (seq_params->seq_level_idx[i] >= SEQ_LEVEL_4_0)
diff --git a/test/invalid_file_test.cc b/test/invalid_file_test.cc
index 4cbf29ed4a..9a052b4f16 100644
--- a/test/invalid_file_test.cc
+++ b/test/invalid_file_test.cc
@@ -13,7 +13,6 @@
 #include <ostream>
 #include <string>

-#include "config/aom_config.h"
 #include "gtest/gtest.h"
 #include "test/codec_factory.h"
 #include "test/ivf_video_source.h"
@@ -132,7 +131,7 @@ const DecodeParam kAV1InvalidFileTests[] = {
   { 1, "invalid-google-142530197-1.ivf", nullptr },
   { 4, "invalid-oss-fuzz-9463.ivf", "invalid-oss-fuzz-9463.ivf.res.2" },
   { 1, "invalid-oss-fuzz-9720.ivf", nullptr },
-  { 1, "invalid-oss-fuzz-10389.ivf", "invalid-oss-fuzz-10389.ivf.res.5" },
+  { 1, "invalid-oss-fuzz-10389.ivf", "invalid-oss-fuzz-10389.ivf.res.4" },
 #if !defined(CHROMIUM) && !CONFIG_SIZE_LIMIT ||         \
     (CONFIG_SIZE_LIMIT && DECODE_WIDTH_LIMIT >= 5120 && \
      DECODE_HEIGHT_LIMIT >= 180)
@@ -152,7 +151,11 @@ const DecodeParam kAV1InvalidFileTests[] = {
   { 1, "invalid-oss-fuzz-10227.ivf", nullptr },
   { 4, "invalid-oss-fuzz-10555.ivf", nullptr },
   { 1, "invalid-oss-fuzz-10705.ivf", nullptr },
+#if CONFIG_CWG_C013
   { 1, "invalid-oss-fuzz-10723.ivf", "invalid-oss-fuzz-10723.ivf.res.3" },
+#else
+  { 1, "invalid-oss-fuzz-10723.ivf", "invalid-oss-fuzz-10723.ivf.res.2" },
+#endif
   { 1, "invalid-oss-fuzz-10779.ivf", nullptr },
   { 1, "invalid-oss-fuzz-11477.ivf", nullptr },
   { 1, "invalid-oss-fuzz-11479.ivf", "invalid-oss-fuzz-11479.ivf.res.2" },
diff --git a/test/test-data.sha1 b/test/test-data.sha1
index e302ee213d..3cf1354ce4 100644
--- a/test/test-data.sha1
+++ b/test/test-data.sha1
@@ -16,7 +16,7 @@ c9e06c4c7fb7d69fd635a1f606a5e478d60e99cf *invalid-oss-fuzz-10117-mc-buf-use-high
 91a5bedeb4832c1c2900736cc0f644bb63971bbc *invalid-oss-fuzz-10227.ivf
 b055f06b9a95aaa5697fa26497b592a47843a7c8 *invalid-oss-fuzz-10227.ivf.res
 b2d0a29a65879436bf483d04865faca7d11cc2ee *invalid-oss-fuzz-10389.ivf
-ddd9f38cd81a88e53ef71879adbaa40bac02e634 *invalid-oss-fuzz-10389.ivf.res.5
+f4ce175af1d871ed1603c8936f6b78e968f93c85 *invalid-oss-fuzz-10389.ivf.res.4
 11df8e9a068669c678097d460b63609d3da73828 *invalid-oss-fuzz-10555.ivf
 b055f06b9a95aaa5697fa26497b592a47843a7c8 *invalid-oss-fuzz-10555.ivf.res
 cf5945085fe85456a1f74bf4cc7998b88b3f4b62 *invalid-oss-fuzz-10705.ivf
diff --git a/test/test_data_util.cmake b/test/test_data_util.cmake
index 10a67feae4..e9e0f0298b 100644
--- a/test/test_data_util.cmake
+++ b/test/test_data_util.cmake
@@ -553,7 +553,7 @@ if(CONFIG_AV1_DECODER)
               "invalid-oss-fuzz-10227.ivf"
               "invalid-oss-fuzz-10227.ivf.res"
               "invalid-oss-fuzz-10389.ivf"
-              "invalid-oss-fuzz-10389.ivf.res.5"
+              "invalid-oss-fuzz-10389.ivf.res.4"
               "invalid-oss-fuzz-10555.ivf"
               "invalid-oss-fuzz-10555.ivf.res"
               "invalid-oss-fuzz-10705.ivf"