diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /third_party/jpeg-xl/lib/jxl/dec_context_map.cc | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/jpeg-xl/lib/jxl/dec_context_map.cc')
-rw-r--r-- | third_party/jpeg-xl/lib/jxl/dec_context_map.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/jpeg-xl/lib/jxl/dec_context_map.cc b/third_party/jpeg-xl/lib/jxl/dec_context_map.cc index 2c936722da..baff87fa49 100644 --- a/third_party/jpeg-xl/lib/jxl/dec_context_map.cc +++ b/third_party/jpeg-xl/lib/jxl/dec_context_map.cc @@ -6,6 +6,7 @@ #include "lib/jxl/dec_context_map.h" #include <algorithm> +#include <cstdint> #include <vector> #include "lib/jxl/ans_params.h" @@ -41,18 +42,18 @@ Status VerifyContextMap(const std::vector<uint8_t>& context_map, Status DecodeContextMap(std::vector<uint8_t>* context_map, size_t* num_htrees, BitReader* input) { - bool is_simple = input->ReadFixedBits<1>(); + bool is_simple = static_cast<bool>(input->ReadFixedBits<1>()); if (is_simple) { int bits_per_entry = input->ReadFixedBits<2>(); if (bits_per_entry != 0) { - for (size_t i = 0; i < context_map->size(); i++) { - (*context_map)[i] = input->ReadBits(bits_per_entry); + for (uint8_t& entry : *context_map) { + entry = input->ReadBits(bits_per_entry); } } else { std::fill(context_map->begin(), context_map->end(), 0); } } else { - bool use_mtf = input->ReadFixedBits<1>(); + bool use_mtf = static_cast<bool>(input->ReadFixedBits<1>()); ANSCode code; std::vector<uint8_t> sink_ctx_map; // Usage of LZ77 is disallowed if decoding only two symbols. This doesn't |