Skip to content

Commit 32c8dda

Browse files
intel-mediadevgfxVPLsdm
authored andcommitted
[AV1][Coverity] Fix INTEGER_OVERFLOW CID 4398015 in order_hint_bits_minus1
GetBits(3) returns uint32_t. In the ternary expression, C++ type promotion makes the result type uint32_t, converting -1 to 4294967295U before assignment to int32_t order_hint_bits_minus1. Use static_cast<int32_t> to preserve signed semantics. Coverity CID: 4398015
1 parent c657f1d commit 32c8dda

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ namespace UMC_AV1_DECODER
14211421
sh.seq_force_integer_mv = 2;
14221422

14231423
sh.order_hint_bits_minus1 =
1424-
sh.enable_order_hint ? GetBits(3) : -1;
1424+
sh.enable_order_hint ? static_cast<int32_t>(GetBits(3)) : -1;
14251425
}
14261426

14271427
sh.enable_superres = GetBit();

0 commit comments

Comments
 (0)