Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A skip is basically a read to a null buffer #2265

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Conversation

mattleibow
Copy link
Contributor

@mattleibow mattleibow commented Sep 29, 2022

Description of Change

Make sure to allow reads to a null buffer as that is how skia does skips.

Bugs Fixed

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

Comment on lines +96 to 98
// NOTE: some skips still requires a read as some streams cannot seek
using var managedBuffer = Utils.RentArray<byte> ((int)size);
var len = stream.Read (managedBuffer.Array, 0, managedBuffer.Length);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not perfect, but I will fix this in a separate PR. The annoying thing is that some streams like and say they are seekable but are not or they allow seeking past the end of the stream causing other issues...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant