summaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src/tpdec_adts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libMpegTPDec/src/tpdec_adts.cpp')
-rw-r--r--libMpegTPDec/src/tpdec_adts.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libMpegTPDec/src/tpdec_adts.cpp b/libMpegTPDec/src/tpdec_adts.cpp
index b5c67c2..c455681 100644
--- a/libMpegTPDec/src/tpdec_adts.cpp
+++ b/libMpegTPDec/src/tpdec_adts.cpp
@@ -374,12 +374,12 @@ int adtsRead_GetRawDataBlockLength(
length = -1; /* raw data block length is unknown */
} else {
if (blockNum < 0 || blockNum > 3) {
- return TRANSPORTDEC_INVALID_PARAMETER;
+ length = -1;
}
length = (pAdts->rawDataBlockDist[blockNum] << 3) - 16;
}
}
- if (blockNum == 0) {
+ if (blockNum == 0 && length > 0) {
length -= pAdts->bs.num_pce_bits;
}
return length;