Don't try to read a negative number of bits

Fixes: 1919/clusterfuzz-testcase-minimized-5021082513833984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Martin Storsjo 2017-06-07 16:17:59 +03:00
parent 4c4da0e39a
commit 21cb19455c
1 changed files with 1 additions and 1 deletions

View File

@ -498,7 +498,7 @@ ReadPsData (HANDLE_PS_DEC h_ps_d, /*!< handle to struct PS_DEC */
h_ps_d->bPsDataAvail[h_ps_d->bsReadSlot] = ppt_none;
/* discard all remaining bits */
nBitsLeft -= startbits - FDKgetValidBits(hBitBuf);
while (nBitsLeft) {
while (nBitsLeft > 0) {
int i = nBitsLeft;
if (i>8) {
i = 8;