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

Array bounds checking in PixelAudioMapper #14

Open
Ignotus-mago opened this issue Jul 20, 2024 · 0 comments
Open

Array bounds checking in PixelAudioMapper #14

Ignotus-mago opened this issue Jul 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Ignotus-mago
Copy link
Owner

Clearly this is going to be the biggest error source. We need to consider how arguments img or sig, signalPos, and length can result in out of bounds errors. Here are some ideas.

General transcoding tools:

  1. Transcode an audio sample array to RGB (with channel specified) or an RGB array to audio range.
  2. With two arrays supplied, source and target, typically we'll write signal to RGB or RGB channel to RGB. They should be the same size.

For write methods that accept both a source (signal or image) and a target (signal or image) and optionally a channel (where applicable):

  1. Source and target are the same size but not necessarily the size of the LUTs, which are not used.
  2. Source, target, and LUTs are the same size
  3. Target is the same size as LUTs and source is either the same size or smaller

For read methods:

  1. Source, array index position and length arguments must be consistent
  2. If position is less than source length but position + length exceeds source length, post a warning and trim length or pad the return array with zeros
  3. if position exceeds source length, throw an error.
@Ignotus-mago Ignotus-mago added the enhancement New feature or request label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant