diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-07-20 01:00:13 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-07-20 01:00:13 +0200 |
commit | 124b5b8108e181eb4860dd25d88dd641dca32e39 (patch) | |
tree | dbbd1423200e0ef23e186f04f9421df1b6b765f7 /src/corelib/serialization/qcborstream.cpp | |
parent | 69ef6e821287d324459336dd1292d19d272386b8 (diff) | |
parent | a96a64be2dc3110d140e43d2cf85454d9fc998b8 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
Diffstat (limited to 'src/corelib/serialization/qcborstream.cpp')
-rw-r--r-- | src/corelib/serialization/qcborstream.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/serialization/qcborstream.cpp b/src/corelib/serialization/qcborstream.cpp index 078c14a32d..c598eee213 100644 --- a/src/corelib/serialization/qcborstream.cpp +++ b/src/corelib/serialization/qcborstream.cpp @@ -1972,7 +1972,15 @@ inline void QCborStreamReader::preparse() if (lastError() == QCborError::NoError) { type_ = cbor_value_get_type(&d->currentElement); - if (type_ != CborInvalidType) { + if (type_ == CborInvalidType) { + // We may have reached the end. + if (d->device && d->containerStack.isEmpty()) { + d->buffer.clear(); + if (d->bufferStart) + d->device->skip(d->bufferStart); + d->bufferStart = 0; + } + } else { d->lastError = {}; // Undo the type mapping that TinyCBOR does (we have an explicit type // for negative integer and we don't have separate types for Boolean, |