aboutsummaryrefslogtreecommitdiff
path: root/src/tile/bitstream/mode_info.cc
diff options
context:
space:
mode:
authorSebastian Ramacher <sramacher@debian.org>2024-12-29 12:50:37 +0000
committerSebastian Ramacher <sramacher@debian.org>2024-12-29 12:50:37 +0000
commit873c687c09e0a1a78a8f3601d31330ad1897e484 (patch)
treeff2fa2e2d27b55c002a6d46d50aab2c66e0bf21a /src/tile/bitstream/mode_info.cc
parent395b1f6877fbc2666383f3428f17400c35aa52a4 (diff)
parentb9ae809f200982119d16ec9613f3db95eca923b9 (diff)
downloadlibgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.gz
libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.tar.bz2
libgav1-873c687c09e0a1a78a8f3601d31330ad1897e484.zip
Merge branch 'master' into 'scrub-obsolete'
# Conflicts: # debian/changelog
Diffstat (limited to 'src/tile/bitstream/mode_info.cc')
-rw-r--r--src/tile/bitstream/mode_info.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/tile/bitstream/mode_info.cc b/src/tile/bitstream/mode_info.cc
index cb7b311..ffbbf64 100644
--- a/src/tile/bitstream/mode_info.cc
+++ b/src/tile/bitstream/mode_info.cc
@@ -890,6 +890,14 @@ uint16_t* Tile::GetReferenceCdf(
block, kReferenceFrameBackward, kReferenceFrameBackward,
kReferenceFrameAlternate2, kReferenceFrameAlternate2);
}
+ // When using GCC 12.x for some targets the compiler reports a false positive
+ // with the context subscript when is_single=false, is_backward=false and
+ // index=0. GetReferenceContext() can only return values between 0 and 2.
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
+ assert(context >= 0 && context <= 2);
if (is_single) {
// The index parameter for single references is offset by one since the spec
// uses 1-based index for these elements.
@@ -900,6 +908,9 @@ uint16_t* Tile::GetReferenceCdf(
.compound_backward_reference_cdf[context][index];
}
return symbol_decoder_context_.compound_reference_cdf[type][context][index];
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
}
void Tile::ReadReferenceFrames(const Block& block, bool skip_mode) {