Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion interpretdfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ enum InterpretDFDResult interpretDFD(const uint32_t *DFD,
isFixed = false;
} else {
uint32_t sampleUpper = KHR_DFDSVAL(BDFDB, i, SAMPLEUPPER);
uint32_t maxVal = 1U << KHR_DFDSVAL(BDFDB, i, BITLENGTH);
// sampleUpper of a longer sample is extended per the spec, which
// gives the same comparison result as 32 bits.
uint32_t bitLength = KHR_DFDSVAL(BDFDB, i, BITLENGTH) + 1;
if (bitLength > 32) bitLength = 32;
uint32_t maxVal = 1U << (bitLength - 1);
if (!isSigned) maxVal <<= 1;
maxVal--;
isFixed = 1U < sampleUpper && sampleUpper < maxVal;
Expand Down
Loading