Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

codec.cc size check incorrect? #12

Open
EvilTrev opened this issue Apr 16, 2020 · 1 comment
Open

codec.cc size check incorrect? #12

EvilTrev opened this issue Apr 16, 2020 · 1 comment

Comments

@EvilTrev
Copy link

if (kBytesPerPixelUNORM8 * width > out_buffer_stride ||
     out_buffer_stride * height < out_buffer_size) {
          // Output buffer too small.
          return false;
     }

If I pass in a buffer with exactly the right size, this would fail. If I passed in a buffer much larger than required, it would also fail? Seems like the logic is inverted on the second condition - unless I'm missing something?

@EvilTrev EvilTrev reopened this Apr 16, 2020
@wwylele
Copy link

wwylele commented Mar 6, 2021

Also found this myself. Agreed that this looks like a mistake.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants