Skip to content

Commit a9c9266

Browse files
committed
PanasonicV8Decompressor::InternalDecoder::decodeNextDiffValue(): assert that lookup is inbounds
1 parent 9798506 commit a9c9266

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librawspeed/decompressors/PanasonicV8Decompressor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ int32_t inline PanasonicV8Decompressor::InternalDecoder::decodeNextDiffValue() {
428428
// Retrieve the difference category, which indicates magnitude of the
429429
// difference between the predicted and actual value.
430430
const auto next16 = uint16_t(mBitPump.peekBits(16));
431+
invariant(mLUT.size() == 1 + UINT16_MAX);
431432
const auto& [codeLen, codeValue] = mLUT(next16);
432433
if (codeValue == 0 && codeLen == 7)
433434
ThrowRDE("Decoding encountered an invalid value!");

0 commit comments

Comments
 (0)