summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-06-07 16:17:59 +0300
committerMartin Storsjo <martin@martin.st>2017-06-12 23:44:43 +0300
commit21cb19455c08555431eb7b4a942df6a9f64c0941 (patch)
tree4dafca27e1ede77180d244f20f1b3354c4bab159
parent4c4da0e39a1f8e7b265110996bceccd145f5bb9c (diff)
downloadfdk-aac-21cb19455c08555431eb7b4a942df6a9f64c0941.tar.gz
fdk-aac-21cb19455c08555431eb7b4a942df6a9f64c0941.tar.bz2
fdk-aac-21cb19455c08555431eb7b4a942df6a9f64c0941.zip
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
-rw-r--r--libSBRdec/src/psbitdec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libSBRdec/src/psbitdec.cpp b/libSBRdec/src/psbitdec.cpp
index 29bddf7..ec6e484 100644
--- a/libSBRdec/src/psbitdec.cpp
+++ b/libSBRdec/src/psbitdec.cpp
@@ -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;