Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Fix Sample App with CAF Decoder#1252

Merged
bbowman merged 1 commit into
microsoft:developfrom
bbowman:bbowman/fixSampleApp
Oct 27, 2016
Merged

Fix Sample App with CAF Decoder#1252
bbowman merged 1 commit into
microsoft:developfrom
bbowman:bbowman/fixSampleApp

Conversation

@bbowman

@bbowman bbowman commented Oct 27, 2016

Copy link
Copy Markdown
Member

Description:
A recent change regressed the CAF decoder work due to a few small issues.
This change address those as follows:

  1. Fixes subscript out of bounds on Debug due to misuse of reserve vs resize
  2. Fixes divide by 0 due to incorrect struct size with variable length array.
  3. Fixes infinite loop due to issue with setup of number of packets to read. That
    code is still incredibly obtuse for whats its doing and should be refactored at a later
    point for maintainability.

How verified:
Sample app launches now. There was much rejoicing.


This change is Reviewable

Description:
A recent change regressed the CAF decoder work due to a few small issues.
This change address those as follows:
1. Fixes subscript out of bounds on Debug due to misuse of reserve vs resize
2. Fixes divide by 0 due to incorrect struct size with variable length array.
3. Fixes infinite loop due to issue with setup of number of packets to read. That
code is still incredibly obtuse for whats its doing and should be refactored at a later
point for maintainability.

How verified:
Sample app launches now. There was much rejoicing.
bytesLeftUntilChunkEnd -= [inStream read:(uint8_t*)&bytesToSkip[0] maxLength:chunkHeader.mChunkSize];
if (chunkHeader.mChunkSize > 0) {
bytesToSkip.resize(chunkHeader.mChunkSize);
bytesLeftUntilChunkEnd -= [inStream read:(uint8_t*)&bytesToSkip[0] maxLength:chunkHeader.mChunkSize];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: bytesToSkip.data()

@DHowett-MSFT

Copy link
Copy Markdown

:shipit:

@bbowman bbowman merged commit 59bb588 into microsoft:develop Oct 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants