 +		if (bitD->bitsConsumed < sizeof(bitD->bitContainer)*8) return BIT_DStream_endOfBuffer;
 +		return BIT_DStream_completed;
 +	}
-+	{   U32 nbBytes = bitD->bitsConsumed >> 3;
++	{	U32 nbBytes = bitD->bitsConsumed >> 3;
 +		BIT_DStream_status result = BIT_DStream_unfinished;
 +		if (bitD->ptr - nbBytes < bitD->start) {
 +			nbBytes = (U32)(bitD->ptr - bitD->start);  /* ptr > start */

+			/* pass-through */
+
+		case zdss_read:
+			{   size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
+				if (neededInSize==0) {  /* end of frame */
+					zds->stage = zdss_init;
+					someMoreWork = 0;

+		dictPtr += matchlengthHeaderSize;
+	}
+
+	{	short litlengthNCount[MaxLL+1];
+		unsigned litlengthMaxValue = MaxLL, litlengthLog;
+		size_t const litlengthHeaderSize = FSE_readNCount(litlengthNCount, &litlengthMaxValue, &litlengthLog, dictPtr, dictEnd-dictPtr);
+		if (FSE_isError(litlengthHeaderSize)) return ERROR(dictionary_corrupted);
