mirror of https://github.com/mstorsjo/fdk-aac.git
Add tighter sanity checks in CBlock_GetEscape
We can't read 31 bits of value here, since that would place the topmost bit in the sign bit. Fixes: 3480/clusterfuzz-testcase-4573445423628288 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
parent
99c95ca3ea
commit
9b47a5e569
|
@ -143,7 +143,8 @@ LONG CBlock_GetEscape(HANDLE_FDK_BITSTREAM bs, /*!< pointer to bitstream */
|
|||
if (FDKreadBit(bs) == 0) break;
|
||||
}
|
||||
|
||||
if (i == 32) return (MAX_QUANTIZED_VALUE + 1);
|
||||
/* (1 << i) will shift into the sign bit if i >= 31 */
|
||||
if (i >= 31) return (MAX_QUANTIZED_VALUE + 1);
|
||||
|
||||
off = FDKreadBits(bs, i);
|
||||
i = off + (1 << i);
|
||||
|
|
Loading…
Reference in New Issue