mirror of https://github.com/mstorsjo/fdk-aac.git
Make sure at least one bit exists before reading further in FDKreadBit
Fixes: 2709/clusterfuzz-testcase-minimized-6160249369133056 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
parent
ecb2ad9a7b
commit
52c2660c26
|
@ -277,11 +277,15 @@ FDK_INLINE UINT FDKreadBit(HANDLE_FDK_BITSTREAM hBitStream)
|
||||||
hBitStream->CacheWord = FDK_get32 (&hBitStream->hBitBuf);
|
hBitStream->CacheWord = FDK_get32 (&hBitStream->hBitBuf);
|
||||||
hBitStream->BitsInCache = CACHE_BITS;
|
hBitStream->BitsInCache = CACHE_BITS;
|
||||||
}
|
}
|
||||||
else
|
else if (validBits > 0)
|
||||||
{
|
{
|
||||||
hBitStream->CacheWord = FDK_get (&hBitStream->hBitBuf,validBits);
|
hBitStream->CacheWord = FDK_get (&hBitStream->hBitBuf,validBits);
|
||||||
hBitStream->BitsInCache = validBits;
|
hBitStream->BitsInCache = validBits;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
hBitStream->BitsInCache--;
|
hBitStream->BitsInCache--;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue