Fix decompression of skippable zstd frames

This commit is contained in:
Tino Reichardt
2018-12-04 21:02:15 +01:00
parent fe790520ab
commit bb06376057

View File

@@ -37,6 +37,11 @@ STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte * prop, UInt32 size)
{
DProps *pProps = (DProps *)prop;
#if DEBUG
printf("prop size =%u\n", size);
fflush(stdout);
#endif
switch (size) {
case 3:
memcpy(&_props, pProps, 3);
@@ -133,6 +138,10 @@ HRESULT CDecoder::CodeSpec(ISequentialInStream * inStream,
if (zIn.pos == zIn.size)
break;
/* end of frame, but more data there... */
if (result == 0 && zIn.pos != zIn.size)
continue;
/* end of frame */
if (result == 0) {
result = ZSTD_resetDStream(_ctx);