summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2017-08-18 22:37:30 +0300
committerMartin Storsjo <martin@martin.st>2017-08-18 22:38:09 +0300
commita3d11689433a046ad57add8ea22dedceb2fe722d (patch)
tree9ef1ca1bc1ffecad3da539138f05c02c256c3d79
parent963b1891562e930a7d997215e700ef5ec5b4461e (diff)
downloadfdk-aac-a3d11689433a046ad57add8ea22dedceb2fe722d.tar.gz
fdk-aac-a3d11689433a046ad57add8ea22dedceb2fe722d.tar.bz2
fdk-aac-a3d11689433a046ad57add8ea22dedceb2fe722d.zip
Adjust the fix for infinite loops with a drained ADTS stream
This should have less risk of causing other issues.
-rw-r--r--libMpegTPDec/src/tpdec_lib.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libMpegTPDec/src/tpdec_lib.cpp b/libMpegTPDec/src/tpdec_lib.cpp
index 09f0703..5760752 100644
--- a/libMpegTPDec/src/tpdec_lib.cpp
+++ b/libMpegTPDec/src/tpdec_lib.cpp
@@ -342,7 +342,9 @@ TRANSPORTDEC_ERROR transportDec_FillData(
}
} else {
/* ... else feed bitbuffer with new stream data (append). */
- FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid);
+ if ((hTp->numberOfRawDataBlocks <= 0) || (FDKgetValidBits(hBs)==0)) {
+ FDKfeedBuffer (hBs, pBuffer, bufferSize, pBytesValid) ;
+ }
}
return TRANSPORTDEC_OK;